use strictures; use Regexp::Common qw/net/; use autodie qw(:all); open my $in, '<:raw', 'Samplle_2.txt'; open my $out, '>:raw', 'Google_1'; while (my $line = <$in>) { my ($ip) = $line =~ /(?: \d+ [ ] ms \s+ ){3} ($RE{net}{IPv4})/msx; print {$out} "$ip\n" if defined $ip; }
In reply to Re: Writing a new file in Perl
by daxim
in thread Writing a new file in Perl
by maheshkumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |