Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by jbert (Priest)
on Nov 03, 2006 at 10:01 UTC ( [id://582042]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://582042]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-25 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found