I want to enter file names to be worked with dynamically i.e I dont want to provide file names at the begnning of the program. I have written following code, but its not working properly.
print "file1 ="; $file1=<stdin>; print "file2 =" ; $file2=<stdin>; @ARGV = {"$file1", "$file2"} ; chomp($remove = <stdin>); chomp($replace = <stdin>); while(defined($line=<>)){ $line =~ s/$remove/$replace/g; print "$line"; }
Pls let me know whats wrong.
In reply to providing filenames dynamically by manish.rathi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |