Try this
use strict; my $arg = $ARGV[0]; open(IN,"$arg")||die("Can't open the input file for reading"); undef $/; my $str = <IN>; close(IN); $/="\n"; print ("\nDo u want to Change Example to Uppercase:"); $value = <STDIN>; chomp($value); if ($value=~/^y$/){ $str=~s/\b(example)\b/uc($1)/gei; } open (OUT,">$arg")||die("Can't open the output file for writing"); print OUT $str; close(OUT);
Vivid
In reply to Re: User input at runtime
by vivid
in thread User input at runtime
by pop18
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |