Thread: returning values from scripts
Results 1 to 5 of 5
Related
-
Yop Scripts - Free Cool Scripts To Use.. Forum: Internet Services
Replies: 1 -
returning value from an onclick event Forum: Javascript Forum
Replies: 3 -
How to pevent uer from returning to page using back button ? Forum: CGI Perl Forum
Replies: 1 -
Getting a blank page while returning from page with form Forum: PHP Forum
Replies: 2
-
04-12-2005, 03:42 AM #1
returning values from scripts
Hi all.
I need to run a script from another script, and to catch a value the first returns. for example :
a.pl :
.
.
.
my $ret_num = 17;
exit ($ret_num);
------------------------------------------
calling the script from another script:
my $temp_num = system(a.pl);
I would like to catch 17 in $temp_num ... but it doesnt work.
any idea?
thanks a lot, Moshe.
-
04-12-2005, 03:50 AM #2
Re: returning values from scripts
Hi, welcome to the forums.
Haven't checked this, but try checking the $? variable. Thats normally the last exit code.If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
04-12-2005, 04:07 AM #3
Re: returning values from scripts
Originally Posted by QuietDean
-
04-12-2005, 04:20 AM #4
Re: returning values from scripts
The funny numbers, I suspect, are the proper exit codes. Usually -1 or 0.
To be honest, I don't think exit codes are meant to be used like this. Wouldn't it be simpler to include the file rather than execute it, and return the number that way?If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
04-12-2005, 04:26 AM #5
Re: returning values from scripts
Originally Posted by QuietDean
Yeah, I guess this is the only thing I can think about ... a bit ugly but I have no other ideas ...
Thanks a lot again ... greetings from Israel
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum