On Thu, Sep 15, 2011 at 12:07 AM, Rajeev Prasad <rp.ne...@yahoo.com> wrote:
> here is how i am calling it from a thecalling_script:
*snip*
>     require "thecalledscript.pl";
*snip*
> issue is, the called script prints some filenames after completion to STDOUT. 
> how can i collect them into an array variable?

You could always make an external call to perl to invoke this program.
For example, using exec or system. E.g.,

  exec('perl', 'thecalledscript.pl', $filename);

It depends on just what thecalledscript.pl does and whether or not
your program needs to do anything in response. I'm unfamiliar with
best practices regarding invoking a Perl script with require, but my
intuition says that it looks like abuse. :)

I've sort of begun to think that nearly any program that you write
should be mostly implemented in a library of sorts to optimize the
software-to-software communication between programs. Then you'd just
basically interface that library with the user and standard
input/output mechanisms. If you control thecalledscript.pl then
perhaps you could consider moving the guts into a Perl module, leaving
only the necessary glue in thecalledscript.pl to interface with the
user and/or standard input/output mechanisms.


-- 
Brandon McCaig <http://www.bamccaig.com/> <bamcc...@gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org>

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to