Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
how can i pass the value from "from.pl" to "to.pl"???



retfej
Novice

Feb 22, 2014, 5:40 AM


Views: 27913
how can i pass the value from "from.pl" to "to.pl"???

just like for example
"from.pl"

$sum = 1 +1;

how can i send/pass it to "to.pl"??

and how can i get the value from "from.pl"??

thanks in advance for then coming answers..


BillKSmith
Veteran

Feb 22, 2014, 8:48 PM


Views: 27875
Re: [retfej] how can i pass the value from "from.pl" to "to.pl"???

We need more information. I think that "to.pl" and "from.pl" are files that contain perl code. Are they complete programs? Does one contain a subroutine of the other? Can one execute the other? Must one finish before the other starts? Must they run in parallel? Do you need multiple copies of either one?

Please tell us more about your original problem. We may be able to suggest a solution that does not use multiple files at all.
Good Luck,
Bill


retfej
Novice

Feb 23, 2014, 5:05 AM


Views: 27872
Re: [BillKSmith] how can i pass the value from "from.pl" to "to.pl"???

i don't know the code to submit value from "from.pl" to "to.pl",..just need example of codes that can do the thing sir..thanks..


Laurent_R
Veteran / Moderator

Feb 23, 2014, 7:59 AM


Views: 27861
Re: [retfej] how can i pass the value from "from.pl" to "to.pl"???

Please kindly provide the information that Bill asked for. We can't help you with such a vague question. For example, can we assume that there is a from.pl program that does some calculations and then calls a to.pl program? Or do you have in mind something else?


BillKSmith
Veteran

Feb 23, 2014, 12:33 PM


Views: 27843
Re: [retfej] how can i pass the value from "from.pl" to "to.pl"???

No one here is going to write and debug examples which may not even apply to your situation.

If "from.pl" and "to.pl" are complete perl programs, why not use your shell to pipe the STDOUT of "from.pl" to the STDIN of "to.pl"? (only works if these handles are not used for anything else!)
Good Luck,
Bill


retfej
Novice

Feb 23, 2014, 2:06 PM


Views: 27835
Re: [Laurent_R] how can i pass the value from "from.pl" to "to.pl"???

you can assume that there is a calculation sir..


FishMonger
Veteran / Moderator

Feb 23, 2014, 9:23 PM


Views: 27814
Re: [retfej] how can i pass the value from "from.pl" to "to.pl"???

If you are unwilling to provide the requested info, then this question will be considered as spam and will be removed.


retfej
Novice

Feb 24, 2014, 4:39 AM


Views: 27797
Re: [FishMonger] how can i pass the value from "from.pl" to "to.pl"???

sir..the calculation is processed in "from.pl" and the value calculated from the "from.pl" will be the output in the "to.pl" ..sorry sir but i don't know how to use subroutines..Frown


FishMonger
Veteran / Moderator

Feb 24, 2014, 8:21 AM


Views: 27781
Re: [retfej] how can i pass the value from "from.pl" to "to.pl"???


Quote
sorry sir but i don't know how to use subroutines.

That's one of the many things you need to learn and is probably what you need to use here, but since you have not shown us your code or given a clear explanation of what you need to do, we can only make guesses. My crystal ball broke many years ago.

Get a good beginning level Perl book and start reading.
http://shop.oreilly.com/product/0636920018452.do


(This post was edited by FishMonger on Feb 24, 2014, 9:11 AM)