Scott,
The problem is that | is a pattern metacharacter, and still needs to be
escaped.
try:
my @arr = split(/\Q$CharSep/, $_);
#########################################
I have a delimited text file with a vertical bar (|) as the column
delimiter. When I execute the following statement...
@Line = split(/\|/, $_);
...I get the expected results.
When I execute the following...
$CharSep="\|";
@Line = split(/$CharSep/, $_);
...the file seems to break at every character. Instead of @Line[0]="Date",
@Line[0]="D", @Line[1]="a", @Line[2]="t",@Line[3]...well, you get the idea.
What do I need to add to the second bit of code to make it work?
Scott
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]