use strict; my $pattern = 'ip address'; open IN_FILE, '<', 'some_file' or die $!; open OUT_FILE, '>', 'some_other_file' or die $!; while(my $line = <FILE>){ print OUT_FILE $line; print OUT_FILE $line if $line =~ /^$pattern/; } close(IN_FILE); close(OUT_FILE);
In reply to Re: How to duplicate lines
by jrsimmon
in thread How to duplicate lines
by ddrew78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |