
BillKSmith
Veteran
Jan 6, 2012, 5:38 AM
Post #2 of 2
(1437 views)
|
Re: [fgstat] Use of uninitialized value within @columns in join or string
[In reply to]
|
Can't Post
|
|
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.
while(<INFILE>) { my @columns = split(/\|/, $_); $columns[3] = ""; my $outline = join('|', @columns); print (OUTFILE $outline); } 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. Good Luck, Bill
|