perl_geoff has asked for the wisdom of the Perl Monks concerning the following question:
Any help is much appreciated!use strict; use warnings; my $out = "Backup/backup.txt"; my $logfile="log.txt"; my $MAL = "\"_"; my $endstring = "\""; my $logfile_new; open LOG, "<", $logfile or die "Cannot open $logfile for read :$!"; open OUT, ">$out" or die "Cannot open $out for write :$!"; while ( <LOG> ) { if ( $_ =~ /$MAL/i ) { # Grab all strings that contain this regex # Save them all in $out } } print OUT "$out";
|
|---|