[28818] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 62 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 22 18:10:24 2007

Date: Mon, 22 Jan 2007 15:10:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 22 Jan 2007     Volume: 11 Number: 62

Today's topics:
        MAC Address Comparison <doni.sekar@gmail.com>
        MAC Address Comparison <doni.sekar@gmail.com>
    Re: MAC Address Comparison <glex_no-spam@qwest-spam-no.invalid>
    Re: MAC Address Comparison <doni.sekar@gmail.com>
    Re: MAC Address Comparison <spamtrap@dot-app.org>
    Re: MAC Address Comparison rkb@i.frys.com
    Re: MAC Address Comparison rkb@i.frys.com
    Re: MAC Address Comparison <doni.sekar@gmail.com>
    Re: MAC Address Comparison <purlgurl@purlgurl.net>
    Re: MAC Address Comparison <john@castleamber.com>
    Re: multiline pattern matching from file <bik.mido@tiscalinet.it>
        Net::FTP::Recursive hangs <vilas_santafe@yahoo.com>
    Re: Net::FTP::Recursive hangs <m@remove.this.part.rtij.nl>
    Re: Net::FTP::Recursive hangs <vilas_santafe@yahoo.com>
        No backtick shell return value <dbasch@yahoo.com>
    Re: No backtick shell return value <bik.mido@tiscalinet.it>
    Re: No backtick shell return value <joe@inwap.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 22 Jan 2007 14:10:16 -0800
From: "doni" <doni.sekar@gmail.com>
Subject: MAC Address Comparison
Message-Id: <1169503815.516460.104430@51g2000cwl.googlegroups.com>

I am trying to search and compare a given mac address with a list of
mac addresses from a file. All the MAC address values are listed in the
first field of each line.
I have tried all the combinations for comparison operation but I am not
getting the desired result.
Here are the ones that I tried where $match variable contains the given
mac address. The MAC address is available in this format:
xx:xx:xx:xx:xx:xx

1. if ($words[0] eq $match)
2. if ($words[0] =~ m/\x$match/)
3. if ($words[0] =~ m/^[$match]/)

Can anyone let me know how should I do this. 

Thanks,
sekar



------------------------------

Date: 22 Jan 2007 14:10:33 -0800
From: "doni" <doni.sekar@gmail.com>
Subject: MAC Address Comparison
Message-Id: <1169503832.917580.106210@51g2000cwl.googlegroups.com>

I am trying to search and compare a given mac address with a list of
mac addresses from a file. All the MAC address values are listed in the
first field of each line.
I have tried all the combinations for comparison operation but I am not
getting the desired result.
Here are the ones that I tried where $match variable contains the given
mac address. The MAC address is available in this format:
xx:xx:xx:xx:xx:xx

1. if ($words[0] eq $match)
2. if ($words[0] =~ m/\x$match/)
3. if ($words[0] =~ m/^[$match]/)

Can anyone let me know how should I do this. 

Thanks,
sekar



------------------------------

Date: Mon, 22 Jan 2007 16:20:38 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: MAC Address Comparison
Message-Id: <45b53831$0$10302$815e3792@news.qwest.net>

doni wrote:
> I am trying to search and compare a given mac address with a list of
> mac addresses from a file. All the MAC address values are listed in the
> first field of each line.
> I have tried all the combinations for comparison operation but I am not
> getting the desired result.
> Here are the ones that I tried where $match variable contains the given
> mac address. The MAC address is available in this format:
> xx:xx:xx:xx:xx:xx
> 
> 1. if ($words[0] eq $match)
> 2. if ($words[0] =~ m/\x$match/)
> 3. if ($words[0] =~ m/^[$match]/)
> 
> Can anyone let me know how should I do this. 

Yes.  Post your code and someone might be able to help.  Posting one
line doesn't help you and only wastes everyone else's time. We have
no idea what's in $words[0], or $match.



------------------------------

Date: 22 Jan 2007 14:24:58 -0800
From: "doni" <doni.sekar@gmail.com>
Subject: Re: MAC Address Comparison
Message-Id: <1169504698.887983.179210@s48g2000cws.googlegroups.com>

thanks, Gleixner. Here is the code I wrote...

#! /usr/bin/perl -w

$ex_data = "stat.txt";
open (DATA,$ex_data) || die("Cannot Open File");

### Prompt the User for Input ###
print "Enter the MAC Address in this format: xx:xx:xx:xx:xx:xx";
$input = <STDIN>;

while (<DATA>) {
    chomp;
    @words = split;
    if ($words[0] =~ m/^[$input]/) {
        print "$words[0]\n";
    }
}
close(DATA);

Thanks,
sekar


J. Gleixner wrote:
> doni wrote:
> > I am trying to search and compare a given mac address with a list of
> > mac addresses from a file. All the MAC address values are listed in the
> > first field of each line.
> > I have tried all the combinations for comparison operation but I am not
> > getting the desired result.
> > Here are the ones that I tried where $match variable contains the given
> > mac address. The MAC address is available in this format:
> > xx:xx:xx:xx:xx:xx
> >
> > 1. if ($words[0] eq $match)
> > 2. if ($words[0] =~ m/\x$match/)
> > 3. if ($words[0] =~ m/^[$match]/)
> >
> > Can anyone let me know how should I do this.
>
> Yes.  Post your code and someone might be able to help.  Posting one
> line doesn't help you and only wastes everyone else's time. We have
> no idea what's in $words[0], or $match.



------------------------------

Date: Mon, 22 Jan 2007 17:37:37 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: MAC Address Comparison
Message-Id: <m2ac0a1ydq.fsf@Sherm-Pendleys-Computer.local>

"doni" <doni.sekar@gmail.com> writes:

Upside-down. Please stop that.

> #! /usr/bin/perl -w

use strict; # Always, yes ALWAYS use strictures
use warnings; # Preferable over -w

> $ex_data = "stat.txt";

You must always declare your variables. Also, see 'perldoc -q quoting' for
a discussion of why "stat.txt" is less than ideal.

my $ex_data = 'stat.txt';

> open (DATA,$ex_data) || die("Cannot Open File");

It's good that's you're checking the return from open() - but it could be
better. Cannot open *what* file, and *why* not? Also, lexical filehandles
and three-arg open() are preferred these days.

open (my $data_f, '<', $ex_data) || die("Cannot open $ex_data: $!");

Have a look at 'perldoc perlopentut' for more about using open() properly.

> ### Prompt the User for Input ###
> print "Enter the MAC Address in this format: xx:xx:xx:xx:xx:xx";
> $input = <STDIN>;

Here's your problem - $input has a \n at the end, just like the lines you're
reading from DATA. The solution is the same:

my $input = <STDIN>;
chomp($input);

> while (<DATA>) {

while (<$data_f>) {

>     chomp;
>     @words = split;

      my @words = split;

>     if ($words[0] =~ m/^[$input]/) {
>         print "$words[0]\n";
>     }
> }
> close(DATA);

It's rare, but errors can happen with close too. Best to check for them:

close($data_f) || die("Cannot close $ex_data: $!");

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: 22 Jan 2007 14:43:15 -0800
From: rkb@i.frys.com
Subject: Re: MAC Address Comparison
Message-Id: <1169505794.943036.158070@a75g2000cwd.googlegroups.com>

doni wrote:
> thanks, Gleixner. Here is the code I wrote...
>
> #! /usr/bin/perl -w
>
> $ex_data = "stat.txt";
> open (DATA,$ex_data) || die("Cannot Open File");
>
> ### Prompt the User for Input ###
> print "Enter the MAC Address in this format: xx:xx:xx:xx:xx:xx";
> $input = <STDIN>;
>
> while (<DATA>) {
>     chomp;
>     @words = split;
>     if ($words[0] =~ m/^[$input]/) {
>         print "$words[0]\n";
>     }
> }
> close(DATA);
>
> Thanks,
> sekar
>
Several problems:
1) You need to chomp $input to remove the line ending.
2) Don't use the character class
3) You should not use DATA as your filehandle, it's the name of one of
Perl's predefined filehandles.



------------------------------

Date: 22 Jan 2007 14:53:49 -0800
From: rkb@i.frys.com
Subject: Re: MAC Address Comparison
Message-Id: <1169506429.705180.277320@51g2000cwl.googlegroups.com>

rkb@i.frys.com wrote:
> doni wrote:
> > thanks, Gleixner. Here is the code I wrote...
> >
> > #! /usr/bin/perl -w
> >
> > $ex_data = "stat.txt";
> > open (DATA,$ex_data) || die("Cannot Open File");
> >
> > ### Prompt the User for Input ###
> > print "Enter the MAC Address in this format: xx:xx:xx:xx:xx:xx";
> > $input = <STDIN>;
> >
> > while (<DATA>) {
> >     chomp;
> >     @words = split;
> >     if ($words[0] =~ m/^[$input]/) {
> >         print "$words[0]\n";
> >     }
> > }
> > close(DATA);
> >
> > Thanks,
> > sekar
> >
> Several problems:
> 1) You need to chomp $input to remove the line ending.
> 2) Don't use the character class
> 3) You should not use DATA as your filehandle, it's the name of one of
> Perl's predefined filehandles.

I forgot 1 other issue.  You should make the regex case insensitive, or
force $input to either upper or lower case depending on what you have
in the stat.txt file.



------------------------------

Date: 22 Jan 2007 14:54:23 -0800
From: "doni" <doni.sekar@gmail.com>
Subject: Re: MAC Address Comparison
Message-Id: <1169506463.556295.89700@q2g2000cwa.googlegroups.com>

thanks sherm and rkb. I am able to get it working perfectly.

I am wondering why do I get this "Use of uninitialized value" warning
message. Can you guys let me know...

thanks,
sekar

rkb@i.frys.com wrote:
> doni wrote:
> > thanks, Gleixner. Here is the code I wrote...
> >
> > #! /usr/bin/perl -w
> >
> > $ex_data = "stat.txt";
> > open (DATA,$ex_data) || die("Cannot Open File");
> >
> > ### Prompt the User for Input ###
> > print "Enter the MAC Address in this format: xx:xx:xx:xx:xx:xx";
> > $input = <STDIN>;
> >
> > while (<DATA>) {
> >     chomp;
> >     @words = split;
> >     if ($words[0] =~ m/^[$input]/) {
> >         print "$words[0]\n";
> >     }
> > }
> > close(DATA);
> >
> > Thanks,
> > sekar
> >
> Several problems:
> 1) You need to chomp $input to remove the line ending.
> 2) Don't use the character class
> 3) You should not use DATA as your filehandle, it's the name of one of
> Perl's predefined filehandles.



------------------------------

Date: Mon, 22 Jan 2007 14:56:14 -0800
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: MAC Address Comparison
Message-Id: <45B5410E.9080900@purlgurl.net>

doni wrote:

> ### Prompt the User for Input ###
> print "Enter the MAC Address in this format: xx:xx:xx:xx:xx:xx";
> $input = <STDIN>;

You need to check your input data for correct format.


> while (<DATA>) {
>     chomp;
>     @words = split;
>     if ($words[0] =~ m/^[$input]/) {
>         print "$words[0]\n";

What are the precise contents of a line of read data?

You leave readers no choice but to guess.
Guessing is not a viable programming method.

Purl Gurl

#!perl

$input = "line";

while (<DATA>)
  {
   if (index ($_, $input) == 0)
    { print substr ($_, 0, index ($_, " ")), "\n"; }
  }

__DATA__
line one
not line to print
line_do_not_print this line



------------------------------

Date: 22 Jan 2007 22:58:17 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: MAC Address Comparison
Message-Id: <Xns98C0ACA3E992castleamber@130.133.1.4>

Sherm Pendley <spamtrap@dot-app.org> wrote:
 
> It's rare, but errors can happen with close too. Best to check for
> them: 

With writing, one example is that close flushes the buffer and your quota 
is exceeded by the action.

Can't think up why close on read can fail atm, but I always check :-)

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: Mon, 22 Jan 2007 18:55:37 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: multiline pattern matching from file
Message-Id: <1fu9r21fn7alk356amhsem43hfpfe3cb9m@4ax.com>

On Mon, 22 Jan 2007 15:44:28 +0100, Michele Dondi
<bik.mido@tiscalinet.it> wrote:

>  open my $file, '<', $file or die "Error opening '$file': $!\n");

D'Oh! Of course there are two severe errors: (i) I reused $file, and
there's an unmatched closing paren.

>      open my $file, '<', $file or die "Error opening `$file': $!\n");

Ditto as above. That's what comes out of posting when in a terrible
hurry...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 22 Jan 2007 11:55:15 -0800
From: "bill" <vilas_santafe@yahoo.com>
Subject: Net::FTP::Recursive hangs
Message-Id: <1169495715.094447.297770@v45g2000cwv.googlegroups.com>

Hi All,

I'm trying to use Net::FTP::Recursive 'rdir' to return recursive
directory listings.
I tried both my own version of a script, and when that did not work, I
tried the script
included in the 2.0 version of Net::FTP::Recursive. I turned on Debug,
and here is the
output (same for both scripts). The script hangs on LIST, then times
out after a few minutes.
I've ftp'ed directory to this site and verified that the directory is
there and has
sub-directories. I've done a little searching for info on the 425 eror
msg, but did not find much useful. I'm running this on Mac OS/X 10.4.8,
perl 5.8.6, Net::FTP::Recursive 2.0.

Can someone help?

Thanks, Bill

$ nftp.pl ftp.ciac.org anonymous wmb@moksha.local /pub /tmp/rec.txt
Net::FTP>>> Net::FTP(2.75)
Net::FTP>>>   Exporter(5.58)
Net::FTP>>>   Net::Cmd(2.26)
Net::FTP>>>   IO::Socket::INET(1.27)
Net::FTP>>>     IO::Socket(1.28)
Net::FTP>>>       IO::Handle(1.24)
Net::FTP=GLOB(0x18ad96c)<<< 220 ciac.org FTP server ready.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> user anonymous
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 331 Guest login ok, send your
complete e-mail address as password.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PASS ....
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 230 Guest login ok, access
restrictions apply.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> TYPE I
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 200 Type set to I.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> CWD /pub
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 250 CWD command successful.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PWD
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 257 "/pub" is current directory.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PWD
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 257 "/pub" is current directory.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PORT 192,168,0,10,194,78
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 200 PORT command successful.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> LIST
Net::FTP::Recursive=GLOB(0x18ad96c): Timeout at /Users/wmb/bin/nftp.pl
line 33

Net::FTP::Recursive=GLOB(0x18ad96c)>>> PWD
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 425 Can't build data connection:
Operation already in progress.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> QUIT
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 257 "/pub" is current directory.



------------------------------

Date: Mon, 22 Jan 2007 21:38:19 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: Net::FTP::Recursive hangs
Message-Id: <pan.2007.01.22.20.38.18.412642@remove.this.part.rtij.nl>

On Mon, 22 Jan 2007 11:55:15 -0800, bill wrote:

> Hi All,
> 
> I'm trying to use Net::FTP::Recursive 'rdir' to return recursive
> directory listings.
> I tried both my own version of a script, and when that did not work, I
> tried the script
> included in the 2.0 version of Net::FTP::Recursive. I turned on Debug,
> and here is the
> output (same for both scripts). The script hangs on LIST, then times
> out after a few minutes.
> I've ftp'ed directory to this site and verified that the directory is
> there and has
> sub-directories. I've done a little searching for info on the 425 eror
> msg, but did not find much useful. I'm running this on Mac OS/X 10.4.8,
> perl 5.8.6, Net::FTP::Recursive 2.0.
> 
> Can someone help?

"Ftp hangs on LIST command" is 99% of the time related to NAT. Did you do
the ftp from the same box? Does that client have any proxy settings?

M4
-- 
Redundancy is a great way to introduce more single points of failure.



------------------------------

Date: 22 Jan 2007 14:10:27 -0800
From: "bill" <vilas_santafe@yahoo.com>
Subject: Re: Net::FTP::Recursive hangs
Message-Id: <1169503827.065882.3100@11g2000cwr.googlegroups.com>

Hi Martin,
thanks for your reply.
Yes, ftp works fine on the same box from the command line:

]$ ftp ftp@ftp.ciac.org
Connected to ciac.org.
220 ciac.org FTP server ready.
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 CWD command successful.
ftp> dir
227 Entering Passive Mode (198,128,39,4,118,187)
150 Opening ASCII mode data connection for /bin/ls.
total 20
drwxrwsr-x  11 webheads     512 Sep  1  1999 ciac
drwxrwsr-x   2 webheads     512 Jan 25  2001 demo
drwxrwsr-x   2 webheads     512 Jan 26  2001 iss
drwxrwsr-x   2 webheads     512 Mar 18  2003 mptc
drwxrwsr-x   2 webheads     512 Jan 26  2001 realsecure
drwxrwsr-x   7 webheads     512 Feb 12  1996 spi
drwxrwsr-x   3 webheads    1536 Sep 24  1999 spinet
drwxrwsr-x   3 webheads     512 Dec 11  1997 spint
drwxrwxr-x   2 webheads     512 Nov 14  2003 ssds
226 Transfer complete.

I do use the firewall, with ftp passive mode ON. I do not have any
proxy servers defined (that I'm aware of). None are set in the network
manager.

Thanks, Bill


Martijn Lievaart wrote:
> On Mon, 22 Jan 2007 11:55:15 -0800, bill wrote:
>
> > Hi All,
> >
> > I'm trying to use Net::FTP::Recursive 'rdir' to return recursive
> > directory listings.
> > I tried both my own version of a script, and when that did not work, I
> > tried the script
> > included in the 2.0 version of Net::FTP::Recursive. I turned on Debug,
> > and here is the
> > output (same for both scripts). The script hangs on LIST, then times
> > out after a few minutes.
> > I've ftp'ed directory to this site and verified that the directory is
> > there and has
> > sub-directories. I've done a little searching for info on the 425 eror
> > msg, but did not find much useful. I'm running this on Mac OS/X 10.4.8,
> > perl 5.8.6, Net::FTP::Recursive 2.0.
> >
> > Can someone help?
>
> "Ftp hangs on LIST command" is 99% of the time related to NAT. Did you do
> the ftp from the same box? Does that client have any proxy settings?
>
> M4
> --
> Redundancy is a great way to introduce more single points of failure.



------------------------------

Date: 22 Jan 2007 10:07:11 -0800
From: "Derek Basch" <dbasch@yahoo.com>
Subject: No backtick shell return value
Message-Id: <1169489231.712682.313040@11g2000cwr.googlegroups.com>

I have a very simple Perl (1) script that calls a bash shell script (2)
and prints the shell STDOUT.

However, It just hangs forever after the shell script (2) returns. I
cannot figure out what I am doing wrong. Any one have an idea?

Here is the Perl script (1):
------------------------------------------------------------------------
open(COMMAND, "$proxy_dir/proxyctl restart |");
while (my $line=<COMMAND>) {
    print $line;
};
close(COMMAND);

print "I won't print";
------------------------------------------------------------------------

Here is the bash shell script:
------------------------------------------------------------------------
#!/bin/bash

THEDIR=/home/proxy/

case "$1" in
    start)
        echo "Starting $THEDIR proxy"
        cd $THEDIR
        $THEDIR/proxy2 &
        ;;
    stop)
        echo "Shutting down $THEDIR proxy"
        PID=`/bin/ps auxwww | /usr/bin/grep "$THEDIR/proxy2 -c
$THEDIR/proxy.conf" | /usr/bin/grep -v grep | awk '{print $2}'`
        #echo "PID: $PID"
        kill $PID
        ;;
    restart)
        $0 stop $THEDIR
        $0 start $THEDIR
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac
------------------------------------------------------------------------

Thanks,
Derek Basch



------------------------------

Date: Mon, 22 Jan 2007 20:07:36 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: No backtick shell return value
Message-Id: <t62ar2hs18rpg8g2d09s5jh819ldeqqd74@4ax.com>

On 22 Jan 2007 10:07:11 -0800, "Derek Basch" <dbasch@yahoo.com> wrote:

>Subject: No backtick shell return value

But you're *not* using backticks below...

>However, It just hangs forever after the shell script (2) returns. I
>cannot figure out what I am doing wrong. Any one have an idea?
>
>Here is the Perl script (1):
>------------------------------------------------------------------------
>open(COMMAND, "$proxy_dir/proxyctl restart |");

Have you tried testing open() for success as is usually recommended?

Anyway I don't see anything terribly wrong, except that I would use a
lexical filehandle and the three args form of open():

  open my $cmd, '-|', "$proxy_dir/proxyctl", 'restart'
    or die "Can't run proxyctl: $!\n";

This way you won't fire up a shell, but directly run the script
passing to it the 'restart' cmd line argument.

BTW: (do a favour to yourself and)

  use strict;
  use warnings;

>Here is the bash shell script:
[snip]

I see this is moderately complex. Have you tried using the above with
a script that simply does e.g.

  echo 'foo bar baz';

? If it works, then you may have a problem with your shell script, not
with the perl one.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Mon, 22 Jan 2007 11:28:59 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: No backtick shell return value
Message-Id: <48adnZFqWpTjjSjYnZ2dnUVZ_oupnZ2d@comcast.com>

Derek Basch wrote:

> However, It just hangs forever after the shell script (2) returns.

perl -le 'print "start";print `sleep 5 & echo OK`'
perl -le 'print "start";print `sleep 5 </dev/null >/dev/null 2>&1 & echo OK`'

The first one waits 5 seconds before printing OK.
The second one prints OK immediately.
	-Joe


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 62
*************************************


home help back first fref pref prev next nref lref last post