Perl Programming/Keywords/join

Previous: ioctl Keywords Next: keys

The join keyword

edit

join joins the elements of LIST with the separators from EXPRESSION. The new string is returned.

Syntax

edit
  join EXPRESSION, LIST

Examples

edit
  The print
  $login = "anton";
  $passwd = "j4\/D\\S";
  $uid = 1721169842;
  $gid = 8421691721;
  $gcos = "nothing";
  $home = "\\";
  $shell = "ksh";

  $rec = join(':', $login, $passwd, $uid, $gid, $gcos, $home, $shell);

  print $rec
returns the colon-separated string elements of the list:
anton:j4/D\S:1721169842:8421691721:nothing:\:ksh

See also

edit
Previous: ioctl Keywords Next: keys