Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: perl one-liner doesn't autochomp input

by broquaint (Abbot)
on Sep 07, 2004 at 10:05 UTC ( #388977=note: print w/ replies, xml ) Need Help??


in reply to perl one-liner doesn't autochomp input

The first effect of using -l is better documented in perlrun

It has two separate effects. First, it automatically chomps $/ (the input record separator) when used with -n or -p.
Not taking full advantage of perl's you could always write your one-liner like this
ls -1 | perl -le 'print join ":", map /(.*)$/, <>'
HTH

_________
broquaint


Comment on Re: perl one-liner doesn't autochomp input
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2014-08-01 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (10 votes), past polls