in reply to passing delimiters on command line
If you trust the user,
$" = eval '"' . $delim . '"'; works.
Use eval with extreme caution, for security reasons.
You could parse it yourself:
%lookup_slash = ( t => "\t", n => "\n", ... );
$delim =~ s/\\(.)/$lookup_slash{$1}/ge;
But do you really expect slashed delimiters other than "\t"? If not, the previous snippet can be simplified to:
$delim =~ s/\\t/\t/g;
Or you could go fancier args...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing delimiters on command line
by Anonymous Monk on Sep 13, 2004 at 16:01 UTC |