Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: How to return Hashref from one script to another script?

by sriram83.life (Acolyte)
on Mar 12, 2014 at 17:26 UTC ( [id://1078055]=note: print w/replies, xml ) Need Help??


in reply to Re: How to return Hashref from one script to another script?
in thread How to return Hashref from one script to another script?

Thanks mate.Now i got it.All references will get clear as soon as script dies.I will write a seperate XML generating module and import that into my child script to produce xml output.I am not aware of how scripts communicate using perlipc.I just called child script from my parent script as follows.
my $hashref = `iim.pl -i $inputfile`;
I expected that output of iim.pl could be a hashref.Now, i get it.We can collect only STDOUT of child script in the parent script.Am i right?
Thanks,
Sriram

Replies are listed 'Best First'.
Re^3: How to return Hashref from one script to another script?
by GotToBTru (Prior) on Mar 12, 2014 at 18:04 UTC

    As long as you start the child script as you are, yes, the communication directly between parent and child is limited to STDOUT and possibly STDERR. There are many ways to communicate indirectly: have the child write the xml data out to a file which the parent will open, for instance. In your case, passing the XML directly back to the parent seems the best idea.

    perlipc discusses inter-process communication, exchanging messages between independent processes running at the same time. I've read that myself, but I can't claim to understand how it works. Threads are another way to accomplish the same thing and communication between is easier. See these tutorials for more information.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found