Newbie external script return question.
From: Jimmy Phillips (sendto_at_spammers.com)
Date: 09/07/04
- Next message: Gunnar Hjalmarsson: "Re: Newbie external script return question."
- Previous message: steffen staehle: "Re: signal handlers: does %SIG{'CLD'} require explicit SA_NOCLDSTOP via POSIX funcs?"
- Next in thread: Gunnar Hjalmarsson: "Re: Newbie external script return question."
- Reply: Gunnar Hjalmarsson: "Re: Newbie external script return question."
- Reply: Jürgen Exner: "Re: Newbie external script return question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 07 Sep 2004 15:42:12 +0200
I am playing with how to call external scripts but can't get the return
value. Example
Caller script...
*************
#!/usr/bin/perl -w
use strict;
my $result = `./dice.pl 5`;
print $result . "\n";
The called script...
*************
#!/usr/bin/perl -w
use strict;
my $randresult;
$randresult = rand $ARGV[0];
If I run the called script with a commandline ./dice.pl 30 it works fine.
The caller script calls ok but gets back an undef. Obviously because
nothing got returned.
Question, how do I specify the $randresult to be a return value? The
keywork "return" is no good outside of a subroutine.
What am I missing?
Thanks
JP
- Next message: Gunnar Hjalmarsson: "Re: Newbie external script return question."
- Previous message: steffen staehle: "Re: signal handlers: does %SIG{'CLD'} require explicit SA_NOCLDSTOP via POSIX funcs?"
- Next in thread: Gunnar Hjalmarsson: "Re: Newbie external script return question."
- Reply: Gunnar Hjalmarsson: "Re: Newbie external script return question."
- Reply: Jürgen Exner: "Re: Newbie external script return question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|