[28606] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9970 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 15 18:05:53 2006

Date: Wed, 15 Nov 2006 15:05:11 -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           Wed, 15 Nov 2006     Volume: 10 Number: 9970

Today's topics:
        .so file not found: I need troubleshooting ideas <socyl@987jk.com.invalid>
    Re: .so file not found: I need troubleshooting ideas xhoster@gmail.com
    Re: Bitwise operator - what am I doing wrong?? <quetzalcotl@consultant.com>
    Re: Bitwise operator - what am I doing wrong?? <rvtol+news@isolution.nl>
    Re: Bitwise operator - what am I doing wrong?? <bik.mido@tiscalinet.it>
    Re: Bitwise operator - what am I doing wrong?? <someone@example.com>
        encoding fred78980@yahoo.com
    Re: encoding <spamtrap@dot-app.org>
    Re: encoding <trwww@sbcglobal.net>
    Re: FAQ 7.21 What's the difference between calling a fu <justin.0611@purestblue.com>
    Re: FAQ 7.21 What's the difference between calling a fu <spamtrap@dot-app.org>
    Re: FAQ 7.21 What's the difference between calling a fu <rvtol+news@isolution.nl>
    Re: FAQ 7.21 What's the difference between calling a fu <justin.0611@purestblue.com>
    Re: FAQ 7.21 What's the difference between calling a fu <rvtol+news@isolution.nl>
        FAQ 7.7 : bug ? <cmic@caramail.com>
    Re: FAQ 7.7 : bug ? <spamtrap@dot-app.org>
    Re: FAQ 7.7 : bug ? <uri@stemsystems.com>
    Re: FAQ 7.7 : bug ? <jgibson@mail.arc.nasa.gov>
    Re: FAQ 7.7 : bug ? <bik.mido@tiscalinet.it>
    Re: FAQ 7.7 : bug ? xhoster@gmail.com
    Re: Get remote PC windows shares <shay.rozen@gmail.com>
    Re: Net::SSH::Perl -- can I capture the command prompt? <glex_no-spam@qwest-spam-no.invalid>
        performance: pcre vs perl regex gmlvsk2@gmail.com
    Re: performance: pcre vs perl regex anno4000@radom.zrz.tu-berlin.de
    Re: performance: pcre vs perl regex <john@castleamber.com>
    Re: performance: pcre vs perl regex <wahab@chemie.uni-halle.de>
        Problem in calling two perl scripts one after the other saki80@gmail.com
    Re: Problem in calling two perl scripts one after the o anno4000@radom.zrz.tu-berlin.de
    Re: Problem in calling two perl scripts one after the o <spamtrap@dot-app.org>
    Re: Problem in calling two perl scripts one after the o saki80@gmail.com
    Re: Problem in calling two perl scripts one after the o <spamtrap@dot-app.org>
    Re: Problem in calling two perl scripts one after the o <DJStunks@gmail.com>
    Re: Problem in calling two perl scripts one after the o <scobloke2@infotop.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Nov 2006 22:01:28 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: .so file not found: I need troubleshooting ideas
Message-Id: <ejg2no$b9f$1@reader2.panix.com>





I have a CGI script that fails only if I invoke it via an HTTP
request, but not if I run the exact same executable locally.  In
the Apache logs I find an error of the form "Can't locate loadable
object for module Foo::Bar...".  I'm wracking my brains trying to
figure out why the script fails to find the loadable object *only*
when it is run via an HTTP request.

I have checked all the usual reasons.  In particular, 1) the loadable
object is in /some/path/i586-linux-thread-multi/auto/Foo/Bar/Bar.so,
and /some/path/i586-linux-thread-multi is in the @INC of the script
when run via an HTTP request; 2) the loadable object and every
directory in its path are all world-readable and world-executable;
and 3) the executable can find and use this loadable object without
any problem when I invoke it locally.

I have run out of troubleshooting ideas and after hours of trying
to figure this out my brain is mush.  Can anyone suggest something
else I could do to troubleshoot this problem?

Thanks in advance!

kj
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


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

Date: 15 Nov 2006 22:51:38 GMT
From: xhoster@gmail.com
Subject: Re: .so file not found: I need troubleshooting ideas
Message-Id: <20061115175153.203$BZ@newsreader.com>

kj <socyl@987jk.com.invalid> wrote:
> I have a CGI script that fails only if I invoke it via an HTTP
> request, but not if I run the exact same executable locally.  In
> the Apache logs I find an error of the form "Can't locate loadable
> object for module Foo::Bar...".  I'm wracking my brains trying to
> figure out why the script fails to find the loadable object *only*
> when it is run via an HTTP request.
>
> I have checked all the usual reasons.  In particular, 1) the loadable
> object is in /some/path/i586-linux-thread-multi/auto/Foo/Bar/Bar.so,
> and /some/path/i586-linux-thread-multi is in the @INC of the script
> when run via an HTTP request;


Add the line:

-e "/some/path/i586-linux-thread-multi/auto/Foo/Bar/Bar.so" or die $!;

to the program right after the "use CGI::Carp qw(fatalsToBrowser);"


> 2) the loadable object and every
> directory in its path are all world-readable and world-executable;

When you run through the httpd?  Maybe you are running httpd in chroot jail
and can't see that path.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: 15 Nov 2006 06:48:46 -0800
From: "Ingo Menger" <quetzalcotl@consultant.com>
Subject: Re: Bitwise operator - what am I doing wrong??
Message-Id: <1163602126.458259.48960@i42g2000cwa.googlegroups.com>


Suk schrieb:

> hey thanks that now works, but I still dont understand what I was doing
> wrong?
> You have to set @nw to zero first ? Why did you have to do 0 + $nm[$i]
> ?

Because bitwise operators work differently on strings and on integers.
In your orginal program, since you got the "numbers" from the
commandline, they still were strings.
You can force a string to be recognized as number by doing something
numeric with it, adding 0, for example.



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

Date: Wed, 15 Nov 2006 16:15:23 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Bitwise operator - what am I doing wrong??
Message-Id: <ejfehv.3c.1@news.isolution.nl>

Suk schreef:
> Dr.Ruud:
>> Suk:


>>> #!/usr/local/bin/perl
>>> #
>>> our ($ip,$netmask,@ip,@net,@nw);
>>> 
>>> $ip=$ARGV[0];
>>> $netmask=$ARGV[1];
>>> 
>>> @ip=(split(/\./,$ip));
>>> @net=(split(/\./,$netmask));
>> 
>>   $_ += 0 for @net ;

That would make all elements of @net numeric.


>> 
>> 
>>> $i=0;
>>> 
>>> foreach (@ip) {
>>>         $nw[$i]=$_ & $net[$i];
>>>         $i++;
>>> }
>>> 
>>> print "IP: $ip NETMASK: $netmask NETWORK: @nw\n";
>>> 
>>> # ./shownet 136.19.96.178 255.255.254.0
>>> IP: 136.19.96.178 NETMASK: 255.255.254.0 NETWORK: 014 01 04 0
>> 
>> 
>> #!/usr/bin/perl
>>   use warnings;
>>   use strict;
>> 
>>   my @ip = split /\./, my $ip = $ARGV[0] ;
>>   my @nm = split /\./, my $nm = $ARGV[1] ;
>> 
>>   my ($i, @nw) = (0) ;
>> 
>>   $nw[$i] = $_ & (0 + $nm[$i]), $i++ for @ip ;
>> 
>>   print "IP: $ip NETMASK: $nm NETWORK: @nw\n";
> 
> hey thanks that now works, but I still dont understand what I was
> doing wrong?
> You have to set @nw to zero first ?

Nowhere @nw was set to zero first, check again.

Maybe you were confused by

   my ($i, @nw) = (0) ;

and I won't blame you for that because it's ugly. 
It sets $i to 0, but @nw remains unset.


> Why did you have to do 0 + $nm[$i]
> ?

To make it numeric.


$ perl -wle '
  print "b" & "c"
'

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Wed, 15 Nov 2006 20:03:37 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Bitwise operator - what am I doing wrong??
Message-Id: <d0pml212m9gidd5lrvjl7bvsqeg2em11rp@4ax.com>

On 15 Nov 2006 06:48:46 -0800, "Ingo Menger"
<quetzalcotl@consultant.com> wrote:

>Because bitwise operators work differently on strings and on integers.
>In your orginal program, since you got the "numbers" from the
>commandline, they still were strings.
>You can force a string to be recognized as number by doing something
>numeric with it, adding 0, for example.

Incidentally one may mention that notwithstanding differences in
behaviour like this one, in Perl 5 there's no clear definition of
numeric context as opposed to e.g. string contexts, but there will be
in Perl 6, along with syntactically sweet enough means to force each
of them.


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: Wed, 15 Nov 2006 19:46:14 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Bitwise operator - what am I doing wrong??
Message-Id: <a8K6h.5368$_Z2.4396@edtnps89>

Suk wrote:
> I'm trying to get the network number given an IP address and subnet
> mask on the command line
> 
> Why doesnt this work?
> 
> #!/usr/local/bin/perl
> #
> our ($ip,$netmask,@ip,@net,@nw);
> 
> $ip=$ARGV[0];
> $netmask=$ARGV[1];
> 
> @ip=(split(/\./,$ip));
> @net=(split(/\./,$netmask));
> 
> $i=0;
> 
> foreach (@ip) {
>         $nw[$i]=$_ & $net[$i];
>         $i++;
> }
> 
> print "IP: $ip NETMASK: $netmask NETWORK: @nw\n";
> 
> # ./shownet 136.19.96.178 255.255.254.0
> IP: 136.19.96.178 NETMASK: 255.255.254.0 NETWORK: 014 01 04 0

$ perl -le'
use Socket;
my $ip      = q[136.19.96.178];
my $netmask = q[255.255.254.0];
print "IP: $ip NETMASK: $netmask NETWORK: ", inet_ntoa( inet_aton( $ip ) &
inet_aton( $netmask ) );
'
IP: 136.19.96.178 NETMASK: 255.255.254.0 NETWORK: 136.19.96.0




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: 15 Nov 2006 07:42:14 -0800
From: fred78980@yahoo.com
Subject: encoding
Message-Id: <1163605334.501188.216440@k70g2000cwa.googlegroups.com>

Hi,

Is any tool that help recognize the encoding of a document. (tell the
actual encoding) FireFox gives information on encoding but I do not see
ascii. What I need is a tool that can recognize the encoding and
convert from one encoing to another. Is such tool exist ?

Thanks



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

Date: Wed, 15 Nov 2006 10:45:40 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: encoding
Message-Id: <m23b8kiuhn.fsf@Sherm-Pendleys-Computer.local>

fred78980@yahoo.com writes:

> Is any tool that help recognize the encoding of a document.

Have a look at the core module Encode::Guess.

sherm--

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


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

Date: Wed, 15 Nov 2006 21:05:25 GMT
From: "Todd W" <trwww@sbcglobal.net>
Subject: Re: encoding
Message-Id: <piL6h.6546$Sw1.1768@newssvr13.news.prodigy.com>


<fred78980@yahoo.com> wrote in message 
news:1163605334.501188.216440@k70g2000cwa.googlegroups.com...
> Hi,
>
> Is any tool that help recognize the encoding of a document. (tell the
> actual encoding) FireFox gives information on encoding but I do not see
> ascii. What I need is a tool that can recognize the encoding and
> convert from one encoing to another. Is such tool exist ?

You're going to have to spend some time putting together an encoding 
toolbox. Unfortunately, theres no one-size-fits-all toolkit for encoding 
management (that I've found, tips appreciated).

I use a combination of OpenOffice, iconv (man iconv), a slew of perl modules 
and handmade scripts, and web browsers.

Todd W.




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

Date: Wed, 15 Nov 2006 21:06:17 +0000
From: Justin C <justin.0611@purestblue.com>
Subject: Re: FAQ 7.21 What's the difference between calling a function as &foo and foo()?
Message-Id: <justin.0611-734C30.21061715112006@stigmata>

In article <m9jr24-li2.ln1@blue.stonehenge.com>,
 PerlFAQ Server <brian@stonehenge.com> wrote:

>  When you call a function as &foo, you allow that function access to your
>     current @_ values, and you bypass prototypes.

I keep seeing this. What, in Perl, is a prototype? I've tried perldoc -q 
but not joy. Perldoc -f prototype doesn't help me. Where can I read 
about this?

-- 
Justin C, by the sea.


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

Date: Wed, 15 Nov 2006 16:36:10 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: FAQ 7.21 What's the difference between calling a function as &foo and foo()?
Message-Id: <m2mz6sgzp1.fsf@Sherm-Pendleys-Computer.local>

Justin C <justin.0611@purestblue.com> writes:

> I keep seeing this. What, in Perl, is a prototype? I've tried perldoc -q 
> but not joy. Perldoc -f prototype doesn't help me. Where can I read 
> about this?

Have a look at perldoc perlsub - there's a whole section about prototypes
in there.

sherm--

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


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

Date: Wed, 15 Nov 2006 22:38:20 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: FAQ 7.21 What's the difference between calling a function as &foo and foo()?
Message-Id: <ejg50g.1kc.1@news.isolution.nl>

Justin C schreef:

> What, in Perl, is a prototype?

See perlfunc.

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Wed, 15 Nov 2006 21:55:39 +0000
From: Justin C <justin.0611@purestblue.com>
Subject: Re: FAQ 7.21 What's the difference between calling a function as &foo and foo()?
Message-Id: <justin.0611-F4A4C5.21553915112006@stigmata>

In article <m2mz6sgzp1.fsf@Sherm-Pendleys-Computer.local>,
 Sherm Pendley <spamtrap@dot-app.org> wrote:

> Justin C <justin.0611@purestblue.com> writes:
> 
> > I keep seeing this. What, in Perl, is a prototype? I've tried perldoc -q 
> > but not joy. Perldoc -f prototype doesn't help me. Where can I read 
> > about this?
> 
> Have a look at perldoc perlsub - there's a whole section about prototypes
> in there.

Doh! I kinda figured from the FAQ that it was something to do with 
subs... but, stupidly, didn't think of looking there. 

Thanks for the pointer.

-- 
Justin C, by the sea.


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

Date: Wed, 15 Nov 2006 23:26:24 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: FAQ 7.21 What's the difference between calling a function as &foo and foo()?
Message-Id: <ejg7p3.1l4.1@news.isolution.nl>

Dr.Ruud schreef:
> Justin C schreef:
>
>> What, in Perl, is a prototype?
>
> See perlfunc.

Oops, I meant perlsub. Not that perlfunc doesn't have interesting
'prototype' information.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: 15 Nov 2006 13:31:27 -0800
From: "cmic" <cmic@caramail.com>
Subject: FAQ 7.7 : bug ?
Message-Id: <1163626287.063697.303730@h48g2000cwc.googlegroups.com>

Hello.

I am not a Perl Expert but I find that this assertion is false :

------8<-------------------from FAQ 7.7-------------
Although it has the same precedence as in C, Perl's "?:" operator
produces an lvalue. This assigns $x to either $a or $b, depending on
the
trueness of $maybe:        ($maybe ? $a : $b) = $x;
----------8<-----------------

It  should be : $x=($maybe ? $a : $b);
Is a typo or what ?
--
cmic aka Michel Marcon



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

Date: Wed, 15 Nov 2006 16:53:55 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: FAQ 7.7 : bug ?
Message-Id: <m2irhggyvg.fsf@Sherm-Pendleys-Computer.local>

"cmic" <cmic@caramail.com> writes:

> I am not a Perl Expert but I find that this assertion is false :
>
> ------8<-------------------from FAQ 7.7-------------
> Although it has the same precedence as in C, Perl's "?:" operator
> produces an lvalue. This assigns $x to either $a or $b, depending on
> the
> trueness of $maybe:        ($maybe ? $a : $b) = $x;
> ----------8<-----------------
>
> It  should be : $x=($maybe ? $a : $b);
> Is a typo or what ?

Nope, it's not a typo. If you wrote the FAQ example with an if/else statement
instead of ?:, it looks like this:

    if ($maybe) {
        $a = $x;
    } else {
        $b = $x;
    }

Whereas your version assigns either $a or $b to $x, depending on the trueness
of $maybe - precisely the opposite of what the FAQ example is doing. Written
with an if/else statement, your example looks like this:

    if ($maybe) {
        $x = $a;
    } else {
        $x = $b;
    }

sherm--

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


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

Date: Wed, 15 Nov 2006 16:58:37 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: FAQ 7.7 : bug ?
Message-Id: <x7k61wv0c2.fsf@mail.sysarch.com>

>>>>> "c" == cmic  <cmic@caramail.com> writes:

  c> Hello.
  c> I am not a Perl Expert but I find that this assertion is false :

  c> ------8<-------------------from FAQ 7.7-------------
  c> Although it has the same precedence as in C, Perl's "?:" operator
  c> produces an lvalue. This assigns $x to either $a or $b, depending on
  c> the
  c> trueness of $maybe:        ($maybe ? $a : $b) = $x;
  c> ----------8<-----------------

have you tried out that code? if not, how can you find the assertion
false without testing it?

perl -le '( @ARGV ? $yes : $no ) = 'args'; print "Y $yes N $no"' foo
Y args N 
perl -le '( @ARGV ? $yes : $no ) = 'args'; print "Y $yes N $no"'    
Y  N args

  c> It  should be : $x=($maybe ? $a : $b);

that ?: doesn't return lvalue which is something that can be assigned
TO. the FAQ example does. you need to learn more about lvalues.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Wed, 15 Nov 2006 13:58:48 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: FAQ 7.7 : bug ?
Message-Id: <151120061358480829%jgibson@mail.arc.nasa.gov>

In article <1163626287.063697.303730@h48g2000cwc.googlegroups.com>,
cmic <cmic@caramail.com> wrote:

> Hello.
> 
> I am not a Perl Expert but I find that this assertion is false :
> 
> ------8<-------------------from FAQ 7.7-------------
> Although it has the same precedence as in C, Perl's "?:" operator
> produces an lvalue. This assigns $x to either $a or $b, depending on
> the
> trueness of $maybe:        ($maybe ? $a : $b) = $x;
> ----------8<-----------------
> 
> It  should be : $x=($maybe ? $a : $b);
> Is a typo or what ?

What. It is not a typo. Try it:

jim 33% perl -e '$x=1;$w=1;($w?$y:$z)=$x;print"y=$y,z=$z\n";'
y=1,z=
jim 34% perl -e '$x=1;$w=0;($w?$y:$z)=$x;print"y=$y,z=$z\n";'
y=,z=1


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

Date: Wed, 15 Nov 2006 23:26:33 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 7.7 : bug ?
Message-Id: <br4nl2hqjeu9ui6cvnvbt3h1dn3893l1aa@4ax.com>

On 15 Nov 2006 13:31:27 -0800, "cmic" <cmic@caramail.com> wrote:

>I am not a Perl Expert but I find that this assertion is false :
>
>------8<-------------------from FAQ 7.7-------------
>Although it has the same precedence as in C, Perl's "?:" operator
>produces an lvalue. This assigns $x to either $a or $b, depending on
>the
>trueness of $maybe:        ($maybe ? $a : $b) = $x;
>----------8<-----------------
>
>It  should be : $x=($maybe ? $a : $b);
>Is a typo or what ?

It's not a typo and the assertion is not false. The whole point about
it is that it claims that C<?:> returns an *lvalue*, and the example
exactly shows one such use, which you couldn't do if that was not the
case, whereas your "correction" doesn't.


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: 15 Nov 2006 22:56:41 GMT
From: xhoster@gmail.com
Subject: Re: FAQ 7.7 : bug ?
Message-Id: <20061115175657.083$mG@newsreader.com>

"cmic" <cmic@caramail.com> wrote:
> Hello.
>
> I am not a Perl Expert but I find that this assertion is false :
>
> ------8<-------------------from FAQ 7.7-------------
> Although it has the same precedence as in C, Perl's "?:" operator
> produces an lvalue. This assigns $x to either $a or $b, depending on
> the
> trueness of $maybe:        ($maybe ? $a : $b) = $x;
> ----------8<-----------------
>
> It  should be : $x=($maybe ? $a : $b);
> Is a typo or what ?

It is a reado.  Your code assigns to $x *from* either $a or $b.  The
original code assigns $x *to* either $a or $b.  You are reading a "from"
in the docs when one does not exist.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: 15 Nov 2006 12:21:51 -0800
From: "ikeon" <shay.rozen@gmail.com>
Subject: Re: Get remote PC windows shares
Message-Id: <1163622111.272989.133710@m73g2000cwd.googlegroups.com>


MoshiachNow wrote:
> HI,
>
> I use Win32::Lanman for this goal fine on XP,however same perl script
> finds no remote shares if run on W2K or W2003.
>
> Is there any other method of getting the remote shares ?
> Thanks
>
> Code:
>
> if( Win32::Lanman::NetShareEnum( $Machine, \@List ) ) {
>     foreach my $Share ( @List )    {
>            my $SHARE = $Share->{netname};
>            if ($SHARE !~ /.*\$/) {
>          push(@SHARES,$SHARE) if ($SHARE ne "");
>        }
>     }

You can try Filesys::SmbClientParser.
http://search.cpan.org/~alian/Filesys-SmbClientParser-2.7/SmbClientParser.pm



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

Date: Wed, 15 Nov 2006 10:23:45 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Net::SSH::Perl -- can I capture the command prompt?
Message-Id: <455b3f30$0$10298$815e3792@news.qwest.net>

Keith wrote:
> I've been using Net::SSH::Perl to log in to Cisco routers and perform
> tasks, but there's one thing I can't seem to do.  Without opening an
> actual interactive shell, I just want to capture (in a string) the
> actual command prompt upon logging in.  For example, when you log into
> a Cisco router via a telnet or SSH shell, the prompt is normally
> something like "Router>".
[...]

Take a look at the Expect module.


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

Date: 15 Nov 2006 13:36:00 -0800
From: gmlvsk2@gmail.com
Subject: performance: pcre vs perl regex
Message-Id: <1163626560.156851.172500@b28g2000cwb.googlegroups.com>

Does anybody know difference in performance if
1) I use C with pcre library
2) I use perl

For the same regular expressions looped many times, with remembering
values in parentesis
would 1 be sevaral times faster
or vice verse

Thanks



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

Date: 15 Nov 2006 22:22:30 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: performance: pcre vs perl regex
Message-Id: <4s1i96Ftc5m4U1@mid.dfncis.de>

 <gmlvsk2@gmail.com> wrote in comp.lang.perl.misc:
> Does anybody know difference in performance if
> 1) I use C with pcre library
> 2) I use perl
> 
> For the same regular expressions looped many times, with remembering
> values in parentesis
> would 1 be sevaral times faster
> or vice verse

Only benchmarks on specific machines can answer that.  I doubt
anyone is going to run them for you.

Anno


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

Date: 15 Nov 2006 22:23:22 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: performance: pcre vs perl regex
Message-Id: <Xns987CA6B81FE2castleamber@130.133.1.4>

gmlvsk2@gmail.com wrote:

> Does anybody know difference in performance if
> 1) I use C with pcre library
> 2) I use perl
> 
> For the same regular expressions looped many times, with remembering
> values in parentesis
> would 1 be sevaral times faster
> or vice verse

Benchmark your code, since that will give you *the* answer for your 
environment. Otherwise, provide code we can benchmark on our system (not 
promising "we" do though).

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

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


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

Date: Wed, 15 Nov 2006 23:37:01 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: performance: pcre vs perl regex
Message-Id: <ejg551$j3e$1@mlucom4.urz.uni-halle.de>

Thus spoke gmlvsk2@gmail.com (on 2006-11-15 22:36):

> Does anybody know difference in performance if
> 1) I use C with pcre library
> 2) I use perl

3) use TCL

> For the same regular expressions looped many times, with remembering
> values in parentesis would 1 be sevaral times faster or vice versa

(my) rule of thumb: If it contains alterations,
TCL will win, Perl comes last - otherwise
Perl comes first or is hairwidth behind
TCL.

But the above remarks may mean
almost nothing for you - only
you know, what your problem
really looks like.


Regards

Mirco



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

Date: 15 Nov 2006 06:20:06 -0800
From: saki80@gmail.com
Subject: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <1163600406.808340.268870@m73g2000cwd.googlegroups.com>

Hi All,
  I am calling perl scripts b.pl & c.pl from a.pl which takes three
arguments. I want to pass these command line arguments to b.pl & c.pl
also. so i could not do this by using 'system'.  so ito continue my
work that time i hardcoded the parameters while calling b.pl & c.pl as
shown below

a.pl  1.1.1.1   1.1.1.2   1.1.1.3
a.pl
=========
 .
 .
 .

system('b.pl', ip_address1);
system('c.pl', ip_address2, ip_address3);

where ip_address1, ip_address2 & ip_address3 are hardcoded vaules...

but if i use 'exec' in place of 'system', i could make use of the
ARGV(command line arguments for a.pl) as command line arguments for
b.pl & c.pl...

a.pl  1.1.1.1   1.1.1.2   1.1.1.3
a.pl
=========
 .
 .
 .

exec "b.pl", $ARGV[1];
exec "c.pl", $ARGV[0], $ARGV[2];

but the problem is if i call two exec's , only one is getting
called..but if i use one at a time by commenting the other it is
working fine.

How can i call two exec one after the other so that both will execute.

Rgds
SaiKiran



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

Date: 15 Nov 2006 14:37:40 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <4s0n1kFt9d6tU1@mid.dfncis.de>

 <saki80@gmail.com> wrote in comp.lang.perl.misc:
> Hi All,
>   I am calling perl scripts b.pl & c.pl from a.pl which takes three
> arguments. I want to pass these command line arguments to b.pl & c.pl
> also. so i could not do this by using 'system'.

Why do you say that?

> so ito continue my
> work that time i hardcoded the parameters while calling b.pl & c.pl as
> shown below
> 
> a.pl  1.1.1.1   1.1.1.2   1.1.1.3
> a.pl
> =========
> .
> .
> .
> 
> system('b.pl', ip_address1);
> system('c.pl', ip_address2, ip_address3);
> 
> where ip_address1, ip_address2 & ip_address3 are hardcoded vaules...
> 
> but if i use 'exec' in place of 'system', i could make use of the
> ARGV(command line arguments for a.pl) as command line arguments for
> b.pl & c.pl...
> 
> a.pl  1.1.1.1   1.1.1.2   1.1.1.3
> a.pl
> =========
> .
> .
> .
> 
> exec "b.pl", $ARGV[1];
> exec "c.pl", $ARGV[0], $ARGV[2];
> 
> but the problem is if i call two exec's , only one is getting
> called..but if i use one at a time by commenting the other it is
> working fine.
> 
> How can i call two exec one after the other so that both will execute.

That's against the nature of exec(), it never returns.  Read
"perldoc -f exec" and "perldoc -f system" (again).

Also note that system() and exec() have exactly the same parameters.
Just use system().

Anno


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

Date: Wed, 15 Nov 2006 10:03:06 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <m2ac2siwgl.fsf@Sherm-Pendleys-Computer.local>

saki80@gmail.com writes:

> Hi All,
>   I am calling perl scripts b.pl & c.pl from a.pl which takes three
> arguments. I want to pass these command line arguments to b.pl & c.pl
> also. so i could not do this by using 'system'.

Sure you can - just pass the arguments.

system('b.pl', @ARGV);

> exec "b.pl", $ARGV[1];
> exec "c.pl", $ARGV[0], $ARGV[2];
>
> but the problem is if i call two exec's , only one is getting
> called..

No, exec() is behaving as documented. The problem is that you're expecting
it to do something other than what the docs say it will do.

> How can i call two exec one after the other so that both will execute.

You can't. Read the documentation for the function you're trying to use:

    perldoc -f exec

sherm--

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


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

Date: 15 Nov 2006 10:13:46 -0800
From: saki80@gmail.com
Subject: Re: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <1163614425.930262.266520@i42g2000cwa.googlegroups.com>

Hi,
  Thanks for the response..I don't want to pass all the command line
arguments to both the scripts, instead i want to pass 2nd argument to
b.pl & 1,3 arguments to c.pl...could u tell me how can i do this...

Saikiran.

Sherm Pendley wrote:
> saki80@gmail.com writes:
>
> > Hi All,
> >   I am calling perl scripts b.pl & c.pl from a.pl which takes three
> > arguments. I want to pass these command line arguments to b.pl & c.pl
> > also. so i could not do this by using 'system'.
>
> Sure you can - just pass the arguments.
>
> system('b.pl', @ARGV);
>
> > exec "b.pl", $ARGV[1];
> > exec "c.pl", $ARGV[0], $ARGV[2];
> >
> > but the problem is if i call two exec's , only one is getting
> > called..
>
> No, exec() is behaving as documented. The problem is that you're expecting
> it to do something other than what the docs say it will do.
>
> > How can i call two exec one after the other so that both will execute.
>
> You can't. Read the documentation for the function you're trying to use:
>
>     perldoc -f exec
>
> sherm--
>
> --
> Web Hosting by West Virginians, for West Virginians: http://wv-www.net
> Cocoa programming in Perl: http://camelbones.sourceforge.net



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

Date: Wed, 15 Nov 2006 13:26:13 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <m2r6w4h8hm.fsf@Sherm-Pendleys-Computer.local>

saki80@gmail.com writes:

Upside-down, quoting the entire message he's replying to, including my .sig.
Please stop that. Have you read the posting guidelines that appear here
frequently?

> Sherm Pendley wrote:
>> saki80@gmail.com writes:
>>
>> > Hi All,
>> >   I am calling perl scripts b.pl & c.pl from a.pl which takes three
>> > arguments. I want to pass these command line arguments to b.pl & c.pl
>> > also. so i could not do this by using 'system'.
>>
>> Sure you can - just pass the arguments.
>>
>> system('b.pl', @ARGV);
>>
>> > exec "b.pl", $ARGV[1];
>> > exec "c.pl", $ARGV[0], $ARGV[2];
>
>   Thanks for the response..I don't want to pass all the command line
> arguments to both the scripts, instead i want to pass 2nd argument to
> b.pl & 1,3 arguments to c.pl...could u tell me how can i do this...

*You* (not "u" - we're adults here) do it the same way you pass them to
exec() individually above. Why do you think it might be different when
calling system()?

sherm--

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


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

Date: 15 Nov 2006 11:01:10 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <1163617270.317485.274200@m7g2000cwm.googlegroups.com>

saki80@gmail.com wrote:

> a.pl  1.1.1.1   1.1.1.2   1.1.1.3

> exec "b.pl", $ARGV[1];
> exec "c.pl", $ARGV[0], $ARGV[2];

  C:\tmp>cat a.pl b.pl c.pl
  #!/usr/bin/perl

  use strict;
  use warnings;

  print "I am a.pl [\@ARGV = @ARGV]\n";

  {
    local @ARGV = $ARGV[1];
    do 'b.pl';
  }

  {
    local @ARGV = @ARGV[0,2];
    do 'c.pl';
  }

  __END__

  #!/usr/bin/perl

  use strict;
  use warnings;

  print "I am b.pl [\@ARGV = @ARGV]\n";

  __END__

  #!/usr/bin/perl

  use strict;
  use warnings;

  print "I am c.pl [\@ARGV = @ARGV]\n";

  __END__

  C:\tmp>a.pl 1.1.1.1   1.1.1.2   1.1.1.3
  I am a.pl [@ARGV = 1.1.1.1 1.1.1.2 1.1.1.3]
  I am b.pl [@ARGV = 1.1.1.2]
  I am c.pl [@ARGV = 1.1.1.1 1.1.1.3]


-jp



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

Date: Wed, 15 Nov 2006 14:42:30 +0000
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Problem in calling two perl scripts one after the other using "exec"
Message-Id: <iqKdnXxm2MLHusbYRVnygg@bt.com>

saki80@gmail.com wrote:
> Hi All,
>   I am calling perl scripts b.pl & c.pl from a.pl which takes three
> arguments. I want to pass these command line arguments to b.pl & c.pl
> also. so i could not do this by using 'system'.

You can.

C:>perl -e "system 'echo', $ARGV[0], $ARGV[2]" foo bar baz qux
foo baz

> but the problem is if i call two exec's , only one is getting
> called..but if i use one at a time by commenting the other it is
> working fine.
> 
> How can i call two exec one after the other so that both will execute.

You can't. Read the first sentence of `perldoc -f exec`.


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

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 V10 Issue 9970
***************************************


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