Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to duplicate lines

by ungalnanban (Pilgrim)
on Mar 04, 2010 at 04:49 UTC ( #826606=note: print w/replies, xml ) Need Help??


in reply to How to duplicate lines

See the following code:
it will duplicate the lines starting with "ip address"
use strict; use warnings; open(FH,"data"); foreach(<FH>) { print $_; if ( $_ =~ m/^ip address/) {print $_;} }

--sugumar--

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826606]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2017-02-23 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (339 votes). Check out past polls.