Ask a Question related to PERL Miscellaneous, Design and Development.
-
J. Smith #1
system call question
If I call an external program like so:
system("$bfish") or warn ("$!");
# Everything is ok
But when I pass parameters like so:
system("$bfish","/E","/I:$file","/O:$file.fish","/Q","/P:$bfishpwd") or
warn("$!");
# I get the "Warning: Something's wrong ....", but it still works.
If I use die instead of warn, the program obviously dies.
So can someone tell me what's going on?
I get a warning, but it still works.
Am I passing parameters the wrong way?
I'm running WinXP pro.
Thanks.
J. Smith Guest
-
Some 'System Calls' was Capturing system call output value
On Friday, Nov 14, 2003, at 18:39 US/Pacific, Jerry Rocteur wrote: Wiggins is the one who deserves the point, since he was the one with the... -
system call
Hi- Can someone please tell me how do I modify following line so that the result gets stored in the var. $count = system("$command... -
Call System level DLL from ASP
I posted this on 24th of September and did not get any reply. So I am trying it again - If anybody has any links related to any info, that will be... -
Net::Server and system call
Hi, I'm trying to use Perl module "Net::Server" This module is quiet easy to use, it is really fast to implement Nevertheless i've got a problem... -
timing out a system call
Hi folks, I'm writing my first actual useful perl scripts and I've run into the following problem - I'm using the "system" function to run a... -
Tad McClellan #2
Re: system call question
J. Smith <noemailplease@defunked.net> wrote:
^ ^ ^ ^> system("$bfish") or warn ("$!");
^ ^ ^ ^
perldoc -q vars
What's wrong with always quoting "$vars"?
system($bfish) or warn($!);
--
Tad McClellan SGML consulting
[email]tadmc@augustmail.com[/email] Perl programming
Fort Worth, Texas
Tad McClellan Guest
-
Eric Bohlman #3
Re: system call question
"J. Smith" <noemailplease@defunked.net> wrote in
news:vm744i46nl3h6b@corp.supernews.com:
That means that the external program is returning a non-zero exit status in> If I call an external program like so:
> system("$bfish") or warn ("$!");
> # Everything is ok
>
> But when I pass parameters like so:
> system("$bfish","/E","/I:$file","/O:$file.fish","/Q","/P:$bfishpwd") or
> warn("$!");
> # I get the "Warning: Something's wrong ....", but it still works.
the second case, but not the first. To find out why, you need to determine
the exit status you're getting (perldoc -f system will tell you how) and
then find out what the external program means by it.
Since system() doesn't set $!, the text of the warning you print is going
to be meaningless and misleading.
>
> If I use die instead of warn, the program obviously dies.
> So can someone tell me what's going on?
>
> I get a warning, but it still works.
> Am I passing parameters the wrong way?
>
> I'm running WinXP pro.
>
> Thanks.
>
>Eric Bohlman Guest
-
John J. Trammell #4
Re: system call question
On Sat, 13 Sep 2003 16:48:05 -0500, J. Smith <noemailplease@defunked.net> wrote:
Read "perldoc -f system", paying close attention to system()'s return> If I call an external program like so:
> system("$bfish") or warn ("$!");
> # Everything is ok
>
> But when I pass parameters like so:
> system("$bfish","/E","/I:$file","/O:$file.fish","/Q","/P:$bfishpwd") or
> warn("$!");
> # I get the "Warning: Something's wrong ....", but it still works.
>
> If I use die instead of warn, the program obviously dies.
> So can someone tell me what's going on?
>
value. And what's with all the useless quotes? Those things don't
grow on trees ya know!
John J. Trammell Guest
-
John W. Krahn #5
Re: system call question
"J. Smith" wrote:
If you read the documentation for the system function you will see that>
> If I call an external program like so:
> system("$bfish") or warn ("$!");
> # Everything is ok
>
> But when I pass parameters like so:
> system("$bfish","/E","/I:$file","/O:$file.fish","/Q","/P:$bfishpwd") or
> warn("$!");
> # I get the "Warning: Something's wrong ....", but it still works.
>
> If I use die instead of warn, the program obviously dies.
> So can someone tell me what's going on?
>
> I get a warning, but it still works.
> Am I passing parameters the wrong way?
it DOES NOT return true on success and false on failure as you seem to
assume.
perldoc -f system
John
--
use Perl;
program
fulfillment
John W. Krahn Guest
-
J. Smith #6
Re: system call question
Thank you Eric.
All is well now. No more warnings.
Super!!
"Eric Bohlman" <ebohlman@earthlink.net> wrote in message
news:Xns93F5B60D2EA48ebohlmanomsdevcom@130.133.1.4 ...in> "J. Smith" <noemailplease@defunked.net> wrote in
> news:vm744i46nl3h6b@corp.supernews.com:
>>> > If I call an external program like so:
> > system("$bfish") or warn ("$!");
> > # Everything is ok
> >
> > But when I pass parameters like so:
> > system("$bfish","/E","/I:$file","/O:$file.fish","/Q","/P:$bfishpwd") or
> > warn("$!");
> > # I get the "Warning: Something's wrong ....", but it still works.
> That means that the external program is returning a non-zero exit statusdetermine> the second case, but not the first. To find out why, you need to> the exit status you're getting (perldoc -f system will tell you how) and
> then find out what the external program means by it.
>
> Since system() doesn't set $!, the text of the warning you print is going
> to be meaningless and misleading.
>
>>> >
> > If I use die instead of warn, the program obviously dies.
> > So can someone tell me what's going on?
> >
> > I get a warning, but it still works.
> > Am I passing parameters the wrong way?
> >
> > I'm running WinXP pro.
> >
> > Thanks.
> >
> >
J. Smith Guest



Reply With Quote

