Jan 6, 2012, 5:38 AM
Post #2 of 2
Your problem has nothing to do with the fourth column. The first argument of split is a "PATTERN" (regular expression). In the syntax of regular expressions, the pipe (|) character has a special meaning. It must be escaped to represent itself. The first argument of join is a string. In a single quoted string almost all characters represent themselves.
Re: [fgstat] Use of uninitialized value within @columns in join or string
[In reply to]
It is possible to represent special characters in a string and/or pattern with a hex escape sequence.This is not at all the same thing as the numeric litteral which you attempted to use. Refer to the syntax of strings and regular expressions.
my @columns = split(/\|/, $_);
$columns = "";
my $outline = join('|', @columns);
print (OUTFILE $outline);