in reply to Re^3: identifying null fields in bar delimited records
in thread identifying null fields in bar delimited records

I would put the escaping backslash into $delim, so you are truly independent. Besides that your code works fine and splits the string as intended.
my ($delim, $line, @fields); $delim = '\|'; $line = "a|c||b"; @fields = split(/$delim/, $line); print join ("*", @fields), "\n"; $delim = ';'; $line = "a;c;;b"; @fields = split(/$delim/, $line); print join ("*", @fields), "\n"; #a*c**b #a*c**b
What else did you expect?


holli, /regexed monk/