develooper Front page | perl.beginners | Postings from January 2002

RE: running commands in bkgd

Thread Previous
From:
Peter Cornelius
Date:
January 15, 2002 20:42
Subject:
RE: running commands in bkgd
Message ID:
NFBBINGEOLCEEMEBEAKFMEFOCCAA.PerlMaven@rm-rfsplat.com
The Perl program will continue on the next line of code.  But the reason to
use back ticks is to easily make the output accessible to the script.  So
the interpreter *has* to wait for the program to finish so that it knows it
has all the out put for the script.  If you don't care about output you
should use 'system();'

At least, that's what I think.

Peter C.

-----Original Message-----
From: Dean Theophilou [mailto:dtheophilou@genisar.com]
Sent: Tuesday, January 15, 2002 5:13 PM
To: Agustin Rivera; Jim Ockers; beginners@perl.org
Subject: RE: running commands in bkgd


Yes, but that doesn't mean that once it finishes it won't continue on to the
next line of code, right?

Dean Theophilou


-----Original Message-----
From: Agustin Rivera [mailto:eleqtriq@eleqtriq.ws]
Sent: Tuesday, January 15, 2002 5:00 PM
To: Dean Theophilou; Jim Ockers; beginners@perl.org
Subject: Re: running commands in bkgd


If you use backticks, Perl is waiting for a return value.  Such as

$var=`echo bunchofdata`;
print $var

--

bunchofdata

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



----- Original Message -----
From: "Dean Theophilou" <dtheophilou@genisar.com>
To: "Agustin Rivera" <eleqtriq@eleqtriq.ws>; "Jim Ockers"
<jockers@mindspring.com>; <beginners@perl.org>
Sent: Tuesday, January 15, 2002 4:29 PM
Subject: RE: running commands in bkgd


> So what you're saying is that the backticks wait until the process is
finished?
> I was wondering about that.  I know that system() doesn't wait; it fires
off the
> command and continues on to the next line.
>
> Dean Theophilou
>
>
> -----Original Message-----
> From: Agustin Rivera [mailto:eleqtriq@eleqtriq.ws]
> Sent: Tuesday, January 15, 2002 4:26 PM
> To: Jim Ockers; beginners@perl.org
> Subject: Re: running commands in bkgd
>
>
> Use the system command.
>
> Agustin Rivera
> Webmaster, Pollstar.com
> http://www.pollstar.com
>
>
>
> ----- Original Message -----
> From: "Jim Ockers" <jockers@mindspring.com>
> To: <beginners@perl.org>
> Sent: Tuesday, January 15, 2002 4:24 PM
> Subject: running commands in bkgd
>
>
> >
> > I'd like to make a perl script that runs queues up jobs.
> >
> > Using the backticks works well except that if I attempt to run
> > something in the background (i.e. `foobar &`) the script pauses until
> > the job is complete.
> >
> > Is this limitation due to the shell rather than perl?
> >
> > Thanks,
> >
> > -Jim
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> > For additional commands, e-mail: beginners-help@perl.org
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org



--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About