in reply to User input at runtime

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

Replies are listed 'Best First'.
Re^2: User input at runtime
by pop18 (Novice) on Dec 13, 2007 at 05:53 UTC
    Thank you very much VIVID...
    This stuff works as per my requirement....

    Thanks
    POP
      This doesn't bode well for your High School midterm...