in reply to Applying a regex across multiple files
Same anonymous monk. Third time's a charm. Apologies again for prior attempted responses
my $raw = '/tmp/tempfile'; my $out = '/var/www/outfile.txt'; my $lines; { open (RAW, "<$raw") or die "Can't open $raw to strip unwanted stuff\n"; local $/ = undef; $lines = <RAW>; close RAW; } $lines =~ s/unwantedstuff //msg; $lines =~ s/moreunwantedstuff //msg; open (OUT, ">$out") or die "Can't open $out\n"; print OUT $lines; close OUT;
janitored by ybiC: Removed extraneous html formatting markup from code
|
|---|