in reply to Re^2: 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?

I tried it with a : seperator, but you're right I didn't use the \t. Mea culpa.
  • Comment on Re^3: Does Perl 5 (or 6?) need another built-in variable for the -F switch?

Replies are listed 'Best First'.
Re^4: Does Perl 5 (or 6?) need another built-in variable for the -F switch?
by Anonymous Monk on Nov 03, 2006 at 11:47 UTC
    Odd. Using \t *does* work (in the sense that it compiles) because join(t, @F) is valid Perl, and all it does is generate a warning. Using : however does not work, unless your Perl can compile join(:, @F).
      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.