Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: User input at runtime

by vivid (Beadle)
on Dec 13, 2007 at 05:12 UTC ( #656752=note: print w/ replies, xml ) Need Help??


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


Comment on Re: User input at runtime
Download Code
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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-10-23 08:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls