Sandeep Kumar has asked for the wisdom of the Perl Monks concerning the following question:
Hope you all are doing good ! I want to use a variable from script "b.pl script" and "b.pl script" uses a package from "a.pm". In my present "c.pl script" I'm using
require 'b.pl'
so as soon as this line executes, it will run the script "b.pl script". but I need to re-direct the output of "b.pl script" to a text file. Earlier I used to run as
Perl b.pl > textfile.txt
separately but now as I need to access a variable from "b.pl script" I use "require" keyword in "c.pl script" but as it is running the "b.pl script", so I need to do output redirection also. Please suggest me how can I do output rediretion when I'm using require keyword Is it like this ?
require 'b.pl > textfile.txt'
but this seems not working. Please tell me what mistake I'm doing here, is there any way to redirect the output of "b.pl" script without using redirection operator ">". Thanks in advance.
|
|---|