in reply to compare size
or if that's the entire script, you could usemy $text; { open(local *INPUT, '<', "data") or die "Unable to open input file: $!\n"; local $/; # Read whole file at once. $text = <INPUT>; } $text =~ s/(\d+)$/ $1 >= 4_000_000_000 ? $1 : "$1 <---- LOW!" ; /emg; { open(local *OUTPUT, '>', "data") or die "Unable to open output file: $!\n"; print OUTPUT ($text; }
#!/usr/bin/perl -pi s/(\d+)$/ $1 >= 4_000_000_000 ? $1 : "$1 <---- LOW!" ; /;
|
|---|