I'm modifying a script someone wrote that basically reads a file file into STDIN, and I was curious if there was anyway of modifying the stdin value without having to first open the file, modify it, close the file, and then open it into stdin.

Basically, looks like:

open(STDIN,$filename) || die "whatever\n";
close(STDOUT);

Well, I need to to a search/replace on STDIN, something like:

open(STDIN,$filename) || die "blah\n";
STDIN =~ s/one/two/g;
close(STDOUT);

Line 2 isn't intended to work, it's just there to show you what i'm trying to accomplish.

Thanks for your help!


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to