Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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--


Comment on Re: How to duplicate lines
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-05-23 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (467 votes), past polls