[31504] in Perl-Users-Digest
Perl-Users Digest, Issue: 2763 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 10 18:09:39 2010
Date: Sun, 10 Jan 2010 15:09:06 -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 Sun, 10 Jan 2010 Volume: 11 Number: 2763
Today's topics:
Re: Error when combining threads and system() sln@netherlands.com
Re: Error when combining threads and system() <tadmc@seesig.invalid>
Re: Error when combining threads and system() <jurgenex@hotmail.com>
Re: Error when combining threads and system() <willem@stack.nl>
Re: Error when combining threads and system() sln@netherlands.com
Re: FAQ 5.4 How can I use Perl's "-i" option from withi <brian.d.foy@gmail.com>
Re: FAQ 5.4 How can I use Perl's "-i" option from withi <marc.girod@gmail.com>
Re: FAQ 5.4 How can I use Perl's "-i" option from withi <spamtrap@shermpendley.com>
Re: FAQ 5.4 How can I use Perl's "-i" option from withi <tadmc@seesig.invalid>
my $short = (split /\//, $Server->File())[$#] <catebekensail@yahoo.com>
Re: my $short = (split /\//, $Server->File())[$#] <xhoster@gmail.com>
Re: my $short = (split /\//, $Server->File())[$#] <rvtol+usenet@xs4all.nl>
Re: my $short = (split /\//, $Server->File())[$#] <tadmc@seesig.invalid>
Re: my $short = (split /\//, $Server->File())[$#] <catebekensail@yahoo.com>
Re: Net::SSH::Expect SSHAuthenticationError Login timed <derykus@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 10 Jan 2010 10:52:17 -0800
From: sln@netherlands.com
Subject: Re: Error when combining threads and system()
Message-Id: <r66kk559ficekdi2andlsrhvdlbj0fgsbo@4ax.com>
On Sat, 9 Jan 2010 23:13:29 +0000 (UTC), Willem <willem@stack.nl> wrote:
>sln@netherlands.com wrote:
>) Works on XP.
>
>As I said above, it only fails on Windows NT.
>
>) Do you have cmd.exe in your path?
>
>Obviously, otherwise the main thread would have failed as well.
>
>
>SaSW, Willem
I don't know what you mean my "Windows NT".
3.5, 3.51, 4.0, W2k, 2003, XP ?
Seriously, 2003 = XP + W2k Server.
Since I have Windows 2000 Server, I just installed ActiveStates Perl
from the "ActivePerl-5.10.0.1004-MSWin32-x86-287188.zip" file on my
W2k server. The results were the same, worked just like it did on XP.
There may be a different installation file for 2003 server though (didn't check).
You stated 5.8 works ok, 5.10 does not. Some things you should try:
- Completely remove one version before installing/testing another.
- Read the 'Release.txt' of the installation for known issues/incompatabilities.
- Check with ActiveState on this, report a possible bug on http://bugs.activestate.com.
- Do a clean install of 2003 server on a spare machine. Take all the defaults, don't
install IIS/Ftp or any extra services. Install Perl 5.10, try your code again.
If there hasn't been any reports of this (it would have come up by now), these
are what ActiveState would suggest to you.
Finally, the AS install's seem to put a lot of registry entries in. These are mostly
installation location and version information, some have class id's.
If you don't want to clean out the registry between installs, the proper way to
go from one version to another (and back) is to designate (keep) the same path to
Perl for each install, renaming the directory to \Perl5.8.8 or something, before
installing the other version. But you have to run the install every time to let
it rewrite the registry entries (for versioning), and at the same time its keeping
paths and such valid.
I would personally run the uninstall each time. The search the registry for 'ActiveState'
or 'ActivePerl', then cleaning those entries out. Then install.
I don't know if you can create restore points in 2003, that may be a way to
snapshot the registry before install, getting back when you need to.
If your code works after this, then you have some other problems.
Without any evidence, no way would I flat out blame the OS or installation.
But there is a problem, or you wouldn't have said it otherwise...
-------------
C:\temp>ver
Microsoft Windows 2000 [Version 5.00.2195]
C:\temp>type cc.pl
use warnings;
use strict;
use threads;
threads->create(\&tests)->join();
tests();
sub tests { system('echo foo') }
C:\temp>perl cc.pl
foo
foo
C:\temp>perl -v
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 5 registered patches, see perl -V for more detail)
Copyright 1987-2007, Larry Wall
Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com
Built Sep 3 2008 13:16:37
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
C:\temp>
-------------
Good luck!
-sln
------------------------------
Date: Sun, 10 Jan 2010 13:15:06 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Error when combining threads and system()
Message-Id: <slrnhkk9k1.7fm.tadmc@tadbox.sbcglobal.net>
sln@netherlands.com <sln@netherlands.com> wrote:
> I don't know what you mean my "Windows NT".
http://lmgtfy.com/?q=Windows+NT
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Sun, 10 Jan 2010 11:51:52 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Error when combining threads and system()
Message-Id: <1ubkk599o0pqolsd9s2hskgjg98cag77p7@4ax.com>
>sln@netherlands.com <sln@netherlands.com> wrote:
>
>> I don't know what you mean my "Windows NT".
Why doesn't that surprise anyone?
jue
------------------------------
Date: Sun, 10 Jan 2010 20:07:31 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: Error when combining threads and system()
Message-Id: <slrnhkkcs3.2mff.willem@turtle.stack.nl>
sln@netherlands.com wrote:
) I don't know what you mean my "Windows NT".
) 3.5, 3.51, 4.0, W2k, 2003, XP ?
Windows NT 4.00.1381
I was wrong about the 2003 bit.
) You stated 5.8 works ok, 5.10 does not. Some things you should try:
No I didn't. I stated it fails to work on _both_ 5.8 and 5.10.
Furthermore you seem to be completely ignoring the crux of the problem:
It works in the main thread and fails in the subthread.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
------------------------------
Date: Sun, 10 Jan 2010 12:44:07 -0800
From: sln@netherlands.com
Subject: Re: Error when combining threads and system()
Message-Id: <efekk557fjivig5r81f8bpnil9leccc1bq@4ax.com>
On Sun, 10 Jan 2010 20:07:31 +0000 (UTC), Willem <willem@stack.nl> wrote:
>sln@netherlands.com wrote:
>) I don't know what you mean my "Windows NT".
>) 3.5, 3.51, 4.0, W2k, 2003, XP ?
>
>Windows NT 4.00.1381
>
>I was wrong about the 2003 bit.
>
>) You stated 5.8 works ok, 5.10 does not. Some things you should try:
>
>No I didn't. I stated it fails to work on _both_ 5.8 and 5.10.
>Furthermore you seem to be completely ignoring the crux of the problem:
>
>It works in the main thread and fails in the subthread.
>
>
>SaSW, Willem
You were wrong about the 2003 bit?
NT 4, goes back a long ways and hasn't been
supported in quite a while, years in fact.
Maybe you should use a distribution from that timeframe.
--------
ActivePerl 1004 -- Release Notes
Welcome, and thank you for downloading ActivePerl. This release
corresponds to Perl version 5.10.
The following platforms are supported by this release:
* AIX 5.1 or later (rs6000)
* Linux: glibc 2.3 or later (x86 and x64)
* Mac OS X 10.4 or later (x86 and powerpc)
* Solaris 2.8 or later (sparc, 32 and 64 bit)
* Solaris 10 or later (x86)
* Windows 2000 (x86)
* Windows XP, 2003, Vista (x86 and x64)
--------
Nope, no NT 4 there.
-sln
------------------------------
Date: Sun, 10 Jan 2010 15:08:29 +0100
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 5.4 How can I use Perl's "-i" option from within a program?
Message-Id: <100120101508295285%brian.d.foy@gmail.com>
In article
<f2754f02-8177-4304-942d-1b0d197a120a@j14g2000yqm.googlegroups.com>,
Marc Girod <marc.girod@gmail.com> wrote:
> On Jan 9, 11:00 am, PerlFAQ Server <br...@theperlreview.com> wrote:
>
> > 5.4: How can I use Perl's "-i" option from within a program?
>
> It is 'perl' there, no?
It depends on what you want to say. Does the -i belong to the language
or the interpreter.
------------------------------
Date: Sun, 10 Jan 2010 06:57:08 -0800 (PST)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: FAQ 5.4 How can I use Perl's "-i" option from within a program?
Message-Id: <33855fa0-eabd-4daa-ba0a-68831fb5ee3c@u7g2000yqm.googlegroups.com>
On Jan 10, 2:08=A0pm, brian d foy <brian.d....@gmail.com> wrote:
> It depends on what you want to say. Does the -i belong to the language
> or the interpreter.
Could a flag belong to the language?
I thought it couldn't.
Marc
------------------------------
Date: Sun, 10 Jan 2010 10:30:38 -0500
From: Sherm Pendley <spamtrap@shermpendley.com>
Subject: Re: FAQ 5.4 How can I use Perl's "-i" option from within a program?
Message-Id: <m2iqbaq8o1.fsf@shermpendley.com>
brian d foy <brian.d.foy@gmail.com> writes:
> In article
> <f2754f02-8177-4304-942d-1b0d197a120a@j14g2000yqm.googlegroups.com>,
> Marc Girod <marc.girod@gmail.com> wrote:
>
>> On Jan 9, 11:00 am, PerlFAQ Server <br...@theperlreview.com> wrote:
>>
>> > 5.4: How can I use Perl's "-i" option from within a program?
>>
>> It is 'perl' there, no?
>
> It depends on what you want to say. Does the -i belong to the language
> or the interpreter.
Given that this FAQ is discussing the command-line option, I'd say that
it clearly belongs to the interpreter.
sherm--
------------------------------
Date: Sun, 10 Jan 2010 09:15:39 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: FAQ 5.4 How can I use Perl's "-i" option from within a program?
Message-Id: <slrnhkjrj3.6f9.tadmc@tadbox.sbcglobal.net>
brian d foy <brian.d.foy@gmail.com> wrote:
> In article
><f2754f02-8177-4304-942d-1b0d197a120a@j14g2000yqm.googlegroups.com>,
> Marc Girod <marc.girod@gmail.com> wrote:
>
>> On Jan 9, 11:00Â am, PerlFAQ Server <br...@theperlreview.com> wrote:
>>
>> > 5.4: How can I use Perl's "-i" option from within a program?
>>
>> It is 'perl' there, no?
>
> It depends on what you want to say. Does the -i belong to the language
> or the interpreter.
-i belongs to perl.
$^I belongs to Perl.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Sun, 10 Jan 2010 10:04:01 -0800 (PST)
From: cate <catebekensail@yahoo.com>
Subject: my $short = (split /\//, $Server->File())[$#]
Message-Id: <17481a3b-bc81-49e0-8f59-5052e55c6a02@j19g2000yqk.googlegroups.com>
Is it possible to do something like that? I can make it work with in
index number. I can make it work with the last array index.
my $short = (split /\//, $Server->File())[$#]
Thank you.
------------------------------
Date: Sun, 10 Jan 2010 10:12:09 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: my $short = (split /\//, $Server->File())[$#]
Message-Id: <4b4a1798$0$31717$ed362ca5@nr5-q3a.newsreader.com>
cate wrote:
> Is it possible to do something like that? I can make it work with in
> index number.
Ah, so then what is the problem/question? Why not use the solution that
works if it works?
my $short = (split /\//, $Server->File())[-1]
> I can make it work with the last array index.
>
> my $short = (split /\//, $Server->File())[$#]
You can? That certainly surprises me.
Xho
------------------------------
Date: Sun, 10 Jan 2010 20:04:54 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: my $short = (split /\//, $Server->File())[$#]
Message-Id: <4b4a24d6$0$22945$e4fe514c@news.xs4all.nl>
cate wrote:
> my $short = (split /\//, $Server->File())[$#]
my ($short) = $Server->File() =~ m~(?:.*/)?(.*)~;
my ($short) = $Server->File() =~ m~([^/]*)$~;
File::Basename
--
Ruud
------------------------------
Date: Sun, 10 Jan 2010 13:12:34 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: my $short = (split /\//, $Server->File())[$#]
Message-Id: <slrnhkk9f9.7fm.tadmc@tadbox.sbcglobal.net>
cate <catebekensail@yahoo.com> wrote:
> I can make it work with the last array index.
>
> my $short = (split /\//, $Server->File())[$#]
There IS NO array there, so then, there IS NO last array index.
perldoc -q "list.*array"
What is the difference between a list and an array?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Sun, 10 Jan 2010 10:17:26 -0800 (PST)
From: cate <catebekensail@yahoo.com>
Subject: Re: my $short = (split /\//, $Server->File())[$#]
Message-Id: <3e3e21d2-13da-4861-b236-2bcd999e4dc2@b2g2000yqi.googlegroups.com>
On Jan 10, 12:12=A0pm, Xho Jingleheimerschmidt <xhos...@gmail.com>
wrote:
> cate wrote:
> > Is it possible to do something like that? =A0I can make it work with in
> > index number.
>
> Ah, so then what is the problem/question? =A0Why not use the solution tha=
t
> works if it works?
>
> my $short =3D =A0(split /\//, $Server->File())[-1]
>
> > I can make it work with the last array index.
>
> > =A0 =A0my $short =3D =A0(split /\//, $Server->File())[$#]
>
> You can? =A0That certainly surprises me.
>
> Xho
thanks.... typo... only in the borros world thanks again
------------------------------
Date: Sun, 10 Jan 2010 03:22:44 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: Net::SSH::Expect SSHAuthenticationError Login timed out.
Message-Id: <1d0c7231-bc1b-40e4-b75a-d51b3b886d01@c34g2000yqn.googlegroups.com>
On Jan 9, 3:08=A0pm, "C.DeRykus" <dery...@gmail.com> wrote:
> On Jan 8, 3:18=A0pm, bsingh <bsinghr...@gmail.com> wrote:
>
>
>
> > I get the following error even though it is clearly connecting. Any
> > amount of timeout is not helping.
> > How do I avoid this exception? Thank you.
>
> > SSHAuthenticationError Login timed out. The input stream currently has
> > the contents bellow: Last login: Fri Jan =A08 20:20:46 2010 from
> > gildb118.flowserve.net
> > =A0at /cygdrive/c/Data/perl_mods/lib/Expect.pm line 828
> > =A0at /cygdrive/c/Data/perl_mods/lib/Net/SSH/Expect.pm line 209
> > =A0 =A0 =A0 =A0 Net::SSH::Expect::__ANON__[/cygdrive/c/Data/perl_mods/l=
ib/Net/
> > SSH/Expect.pm:212]('ARRAY(0x10530758)') called at /cygdrive/c/Data/
> > perl_mods/lib/Expect.pm line 828
> > =A0 =A0 =A0 =A0 Expect::_multi_expect(1, 'ARRAY(0x105308d8)', 'ARRAY
> > (0x10530ae8)') called at /cygdrive/c/Data/perl_mods/lib/Expect.pm line
> > 565
> > =A0 =A0 =A0 =A0 Expect::expect('Expect=3DGLOB(0x10576940)', 1, 'ARRAY
> > (0x105776c0)', 'ARRAY(0x10530218)', 'ARRAY(0x10530338)', 'ARRAY
> > (0x10530458)', 'ARRAY(0x10530590)') called at /cygdrive/c/Data/
> > perl_mods/lib/Net/SSH/Expect.pm line 580
> > =A0 =A0 =A0 =A0 Net::SSH::Expect::_sec_expect('Net::SSH::Expect=3DHASH
> > (0x10517c08)', 1, 'ARRAY(0x105776c0)', 'ARRAY(0x10530218)', 'ARRAY
> > (0x10530338)', 'ARRAY(0x10530458)', 'ARRAY(0x10530590)') called at /
> > cygdrive/c/Data/perl_mods/lib/Net/SSH/Expect.pm line 213
> > =A0 =A0 =A0 =A0 Net::SSH::Expect::login('Net::SSH::Expect=3DHASH(0x1051=
7c08)')
> > called at netsshexpect.pl line 13
>
> > Here's the code
> > ------------------------------------------
> > use Net::SSH::Expect;
>
> > my $ssh =3D Net::SSH::Expect->new (
> > =A0 =A0 =A0 =A0 =A0 =A0host =3D> $host,
> > =A0 =A0 =A0 =A0 =A0 =A0 password=3D> $pwd,
> > =A0 =A0 =A0 =A0 =A0 =A0 user =3D> $usr,
> > =A0 =A0 =A0 =A0 =A0 =A0 raw_pty =3D> 1 ho,
> > =A0 =A0 =A0 =A0 =A0 =A0 timeout =3D> 10
> > =A0 =A0 =A0 =A0 );
>
> > my $login_output =3D $ssh->login();
>
> The Net::SSH::Expect doc shows a keyword search on the
> login() output:
>
> =A0 =A0 =A0 =A0 if ($login_output !~ /Welcome/) {
> =A0 =A0 =A0 =A0 =A0 =A0 die "Login has failed....";
> =A0 =A0 =A0 =A0 }
>
> Did you forget to do that?
>
> > ...
>
Also, I haven't used Net::SSH::Expect but setting the
ssh verbose option might provide some info about where
the login transaction fails or times out.
my $ssh =3D Net::SSH::Expect->new (
host =3D> $host,
password=3D> $pwd,
user =3D> $usr,
ssh_option =3D> "-v -v -v",
...
There are also some expect debug settings that may
be useful at some point.
--
Charles DeRykus
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 2763
***************************************