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

Re: Things every perl programmer should know?

by thelenm (Vicar)
on Jun 04, 2003 at 15:51 UTC ( #263037=note: print w/ replies, xml ) Need Help??


in reply to Things every perl programmer should know?

I use Perl for a lot of quick file-munging (and golf :-), so I've found it very useful to be familiar with the command line options as described in perlrun. The -n, -p, and -i options can be particularly handy if you're just running through files doing something to each line. For example, you can replace "foo" with "bar" in every .txt file in a directory with this one-liner:

perl -pi -e 's/foo/bar/g' dir/*.txt

Very simple, but very powerful. Of course you can do more complex things with this as well.

-- Mike

--
just,my${.02}


Comment on Re: Things every perl programmer should know?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-07-12 04:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls