Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Appending string to all lines

by AnomalousMonk (Archbishop)
on Nov 11, 2016 at 05:42 UTC ( [id://1175721]=note: print w/replies, xml ) Need Help??


in reply to Appending string to all lines

I found a site suggesting this type of command formating ... I tried it within a single line script with strict and warnings. It generated this error ...

One way to get an idea of what a command line "one-liner" would have to look like as a script is to deparse the command line source together with the interpreter switches:

c:\@Work\Perl>perl -MO=Deparse -n -e "chomp; printf qq{%sUF,A,Y,9,U\n}, $_ " LINE: while (defined($_ = <ARGV>)) { chomp $_; printf "%sUF,A,Y,9,U\n", $_; } -e syntax OK
Please see O and B::Deparse. (Update: Please also see perlrun for a discussion of the wrappers the interpreter puts around code when it sees switches like -n and -p.)


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-24 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found