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

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).

Replies are listed 'Best First'.
Re^5: Does Perl 5 (or 6?) need another built-in variable for the -F switch?
by jbert (Priest) on Nov 03, 2006 at 12:30 UTC
    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.