in reply to Re^4: Does Perl 5 (or 6?) need another built-in variable for the -F switch?
in thread Does Perl 5 (or 6?) need another built-in variable for the -F switch?

Hmmph. I (foolishly) re-typed for the comment (with an eye on the original) rather than cut-and-paste my test.

You're absolutely right, this is what I'd used (from my .bash_history):

export F=: perl -na -F$F -e "shift @F; print join('$F', @F);" < foo
This has the problems you noted if $F is anything special to the shell (e.g. \t, contains spaces, etc).

Sorry for the lack of precision in quoting. No real excuses. Will try harder.

  • Comment on Re^5: Does Perl 5 (or 6?) need another built-in variable for the -F switch?
  • Download Code