you could use the diff command:
use strict; use warnings; my $file = "file"; open( FILE, "<", $file) or die "$!\n"; $_ = do { local $/; <FILE> }; close(FILE); s/match/replace/gi; s/match1/replace1/gi; open(my $new_file,'>','new_file')or die "$!\n"; print $new_file $_; close $new_file or die "$!\n"; print `diff $file new_file`;
In reply to Re: Comparing $_ --- before/after
by lamprecht
in thread Comparing $_ --- before/after
by mrc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |