Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files

by Anonymous Monk
on Nov 18, 2012 at 12:37 UTC ( #1004401=note: print w/ replies, xml ) Need Help??


in reply to s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files

Well, -n doesn't print, but -p does print :)

$ perl -le " print qq{a;b;c;d} " a;b;c;d $ perl -le " print qq{a;b;c;d} " | perl -ne " tr/;/\n/ ; " $ perl -le " print qq{a;b;c;d} " | perl -pe " tr/;/\n/ ; " a b c d


Comment on Re: s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files
Download Code
Replies are listed 'Best First'.
Re^2: s/// + tr/// when perl -ni -e on semi-colons in one liners echoed to files
by Don Coyote (Pilgrim) on Nov 18, 2012 at 12:47 UTC

    ok, thanks for the quick reply. It seems I was assuming -i edits 'in place'. And -n / -p only controlled if STDOUT was printed to or not.(i think it was SED).

    Just trying to analyse more complex stuff while tripping over the 'simple' stuff...

        Yes, maybe one for the chatterbox on reflection.

        I'm reading a lot about a lot, packages,modules,symbols, today. Then this invocation frustration arose. Couldn't see the wood for the trees.

        These one liners do seem to have a way of over extending themselves.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2015-08-30 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (350 votes), past polls