split takes a string and splits it into parts separated by a delimiter, which may be any regular expression. E.g., |
@fields = split(/\s+/, $line); # splits string $line into several fields stored in $field[0] $field[1] etc. where these fields were separated by whitespace (\s) in $line |
join inverts the operation although the join string must now be an ordinary single or double-quoted string and not a regular expression as no matching is occuring! |
$line = join( " \t", @fields); # rebuilds $line with space and tab as separator. |