#!perl -i.bak my $newnum = shift; @ARGV = qw( one.txt ); undef $/; # sluurp $_ = <>; s/(Authentication number) \d+/$1 $newnum/; print