[29661] in Perl-Users-Digest
Perl-Users Digest, Issue: 905 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 4 11:09:40 2007
Date: Thu, 4 Oct 2007 08:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 4 Oct 2007 Volume: 11 Number: 905
Today's topics:
Crypt::OpenSSL::RSA - "panic: sv_setpvn called with neg <taylor@metasyntax.net>
exit status of remote commands <gourabbaksi@gmail.com>
Re: exit status of remote commands <ben@morrow.me.uk>
Re: exit status of remote commands <peter@makholm.net>
Re: I have address book with more than <tony@skelding.co.uk>
Re: I have address book with more than <josef.moellers@fujitsu-siemens.com>
Re: jabba the tuh <bik.mido@tiscalinet.it>
Re: jabba the tuh <bik.mido@tiscalinet.it>
Re: jabba the tuh <bik.mido@tiscalinet.it>
Re: jabba the tuh <wyzelli@yahoo.com>
Re: line 16 <bik.mido@tiscalinet.it>
Re: line 16 <bik.mido@tiscalinet.it>
Re: line 16 <bik.mido@tiscalinet.it>
Re: Odd regex behavior <nobull67@gmail.com>
perl join on a non printable variable character ? <jack_posemsky@yahoo.com>
Re: perl join on a non printable variable character ? <tony@skelding.co.uk>
Re: SIG{'PIPE'} <ben@morrow.me.uk>
Re: The Modernization of Emacs: terminology buffer and <lew@lewscanon.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 04 Oct 2007 10:13:05 -0400
From: Taylor Venable <taylor@metasyntax.net>
Subject: Crypt::OpenSSL::RSA - "panic: sv_setpvn called with negative strlen"
Message-Id: <fe2sag$f00$1@registered.motzarella.org>
Hello,
I've read in an RSA private key from a PEM-encoded file and I'm trying to
use the Crypt::OpenSSL::RSA module to decrypt some data. But when I
actually call the decrypt() function on the key object, I get the following
error:
panic: sv_setpvn called with negative strlen
A bit of Googling shows that this has happened before, but never in the same
context, sometimes with a supposed fix (even supposedly in the Perl core
itself) but usually without much mention as to the cure. My current plan
is to just send everything to the command-line implementation of OpenSSL,
but it would be nicer to be able to handle it from the Perl module.
For context, the bit of code that causes the fault is this:
my $rsa = Crypt::OpenSSL::RSA->new_private_key($$data{'private-key'});
$rsa->use_pkcs1_padding();
my $response = $rsa->decrypt($$data{'challenge'});
Where $$data{'private-key'} holds the exact contents of the PEM-encoded
private key file.
Thanks for any ideas!
------------------------------
Date: Thu, 04 Oct 2007 03:45:09 -0700
From: Ironhide <gourabbaksi@gmail.com>
Subject: exit status of remote commands
Message-Id: <1191494709.623689.58580@d55g2000hsg.googlegroups.com>
Hi,
I want to execute some commands on a remote machine through ssh and
get back their results; would ideally like get back the
1. exit status of the command executed remotely
2. stdout
3. stderr
All this I would like to do inside a perl script and get all of the
above 3 in 3 separate variables.
Can this be done?
p.s.: I have already tried the Net::SSH module; would be helpful if
you guys could suggest me other ways of doing this.
--
IronHide
------------------------------
Date: Thu, 4 Oct 2007 13:01:28 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: exit status of remote commands
Message-Id: <o91ft4-bk1.ln1@osiris.mauzo.dyndns.org>
Quoth Ironhide <gourabbaksi@gmail.com>:
> Hi,
>
> I want to execute some commands on a remote machine through ssh and
> get back their results; would ideally like get back the
> 1. exit status of the command executed remotely
> 2. stdout
> 3. stderr
>
> All this I would like to do inside a perl script and get all of the
> above 3 in 3 separate variables.
> Can this be done?
Well, the obvious way is to run ssh(1) with something like IPC::Run...
> p.s.: I have already tried the Net::SSH module; would be helpful if
> you guys could suggest me other ways of doing this.
What was your problem with Net::SSH?
Ben
------------------------------
Date: Thu, 04 Oct 2007 12:08:43 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: exit status of remote commands
Message-Id: <87641nxet0.fsf@hacking.dk>
Ironhide <gourabbaksi@gmail.com> writes:
> I want to execute some commands on a remote machine through ssh and
> get back their results; would ideally like get back the
> 1. exit status of the command executed remotely
> 2. stdout
> 3. stderr
Try using IPC::Open3;
my($wtr, $rdr, $err);
$pid = open3($wtr, $rdr, $err, 'ssh user@host cmd')
# Work with the filehandles $wtr, $rdr and $err
waitpid($pid);
$exit = $? >> 8;
if $exit is 255 the error might be an error with the ssh command and
not you remote command. Otherwise it should be the exit status of you
remote command.
//Makholm
------------------------------
Date: Thu, 04 Oct 2007 03:09:17 -0700
From: Mintcake <tony@skelding.co.uk>
Subject: Re: I have address book with more than
Message-Id: <1191492557.591924.97840@y42g2000hsy.googlegroups.com>
On Oct 3, 3:04 pm, "Bond" <B...@james.bond> wrote:
> I have address book with more than 1000 e-mail address. Bu some of them are
> no good because user cancel it or change e-mail (some are older 10 year).
> How to control witches are bad, so I can delete it. I can export it to text
> file, and read it from perl.
>
> Please Help
If you can export it to a text file and read it from perl the next
step is easy. Learn perl.
------------------------------
Date: Thu, 04 Oct 2007 13:04:59 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: I have address book with more than
Message-Id: <fe2hcu$5kh$1@nntp.fujitsu-siemens.com>
Bond wrote:
> I have address book with more than 1000 e-mail address. Bu some of them=
are
> no good because user cancel it or change e-mail (some are older 10 year=
).
> How to control witches are bad, so I can delete it. I can export it to =
text
> file, and read it from perl.
IMHO there's little you can do but to send everyone an email stating the =
purpose of the email and asking the person for a confirmation that (s)he =
would like to stay in your address book. You could then write a Perl=20
script to sift through your mailbox and gather those messages which=20
didn't bounce and where the person agreed to stay in your address book.
There are several mail related modules at CPAN. If you have problems=20
using one, write a small, self-contained program showing the problem and =
we'll see if we can help.
BTW I, for sure, won't answer that email. From the fact that you didn't=20
use a real name, I guess I'll be glad to fall off your list of "more=20
than 1000 e-mail address"es.
Josef
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
------------------------------
Date: Thu, 04 Oct 2007 12:34:14 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: jabba the tuh
Message-Id: <l0e9g3tq7g1osl8t8qfa5idjpr101ieh22@4ax.com>
On Wed, 3 Oct 2007 16:31:29 -0700, "Wade Ward" <zaxfuuq@invalid.net>
wrote:
>> Yeah... also, "ppl" is one char less than either "perl" or "Perl". But
>> "the ppl" is three more. I don't really see what's the advantage of
>> using that spelling that no other one is familiar with, and is likely
>> to confuse so many people. All in all, an amazing phenomenon...
>>
>How do you start your own ng, s.t. OE with comcast can find it?
>
>Say . all.allin.all.an.amazingthingsppl.albuquerquephenomenon ?
http://www.google.com/search?q=how+to+create+a+newsgroup
OT here.
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: Thu, 04 Oct 2007 12:38:48 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: jabba the tuh
Message-Id: <tgg9g3hh86r53jmjtq0v1fhn2rg3qa30s2@4ax.com>
On Wed, 3 Oct 2007 16:22:12 -0700, "Wade Ward" <zaxfuuq@invalid.net>
wrote:
>>> http://www.zaxfuuq.net/perl4.htm
>>
>> I don't know why you keep posting these links. I don't follow them and
>> I suspect lots of others don't. If they are somehow relevant to your
>> postings, include the text here.
>It's a screendump. What are you missing?
The purpose. Actually I'm missing it too, and I bet most others are,
as well. Care to explain?
>>> How does one type these numbers with the ppl? How many types are there
>>> in
>>> the ppl? Leave out anything more than two levels of indirection on
>>
>> Lots of regulars here bristle unless you talk about Perl or perl. My
>> suggestion is to suck it up and write "Perl" and not "the ppl".
>they can bristle all they want. i program when i'm injured. i don't have a
>left had to hit shift, so ppl is just gonna have to work.
You can happily and IMNSHO more easily type "perl". It won't require
your left hand to hit the shift key.
>> Actual answers to your questions can be found in the very book you're
>> reading.
>But it's a lot of ddigigng. "concatenate" in the index was compleatly
>uninformative.
Actually I think that your choice of starting with the Camel book is
not that appropriate since it is much a reference manual AIUI. Thus
you may be just fine with perldoc. As a complete newbie the Llama book
would be more appropriate to you, instead.
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: Thu, 04 Oct 2007 12:47:01 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: jabba the tuh
Message-Id: <hog9g3l6p1tr7i7nqplci163c3gsn2u31k@4ax.com>
On Wed, 03 Oct 2007 20:15:32 -0500, Jeremy Numer
<jeremy.numer@nowhere.example.com> wrote:
>> I see that I have comment for line 16, and it
>> looks to be from people who a)know what they're talking about
>> b) aren't playing a practical joke on me (recall {debug}in the
>> cunstrcurtprfcrero)
>
>How is anyone other than you supposed to understand this?
I just think he has a sound misunderstanding of how usenet works at
all. He probably refers to an old thread he started a few months ago,
and he's blindily assuming that everybody jumping in will be familiar
with what he's speaking about.
As I've written many other times I'm not an English native speaker,
but I can understand quite about everything that people write here or
elsewhere, but for some sparse random bits. However I have serious
difficulties with his prose, and this rings a bell... I may just be
wrong though.
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: Thu, 04 Oct 2007 11:56:16 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: jabba the tuh
Message-Id: <Ax4Ni.5029$H22.3547@news-server.bigpond.net.au>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:tgg9g3hh86r53jmjtq0v1fhn2rg3qa30s2@4ax.com...
> On Wed, 3 Oct 2007 16:22:12 -0700, "Wade Ward" <zaxfuuq@invalid.net>
> wrote:
<snip>
> Actually I think that your choice of starting with the Camel book is
> not that appropriate since it is much a reference manual AIUI. Thus
> you may be just fine with perldoc. As a complete newbie the Llama book
> would be more appropriate to you, instead.
or even better, Elements of Programming with Perl by Andrew L Johnson, by
Manning Books
http://www.manning.com/johnson/
Best starter book I've read.
P
------------------------------
Date: Thu, 04 Oct 2007 13:31:53 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: line 16
Message-Id: <ikj9g3t7hcodng78i83rao9tlk6s606t1m@4ax.com>
On Wed, 3 Oct 2007 16:24:42 -0700, "Wade Ward" <zaxfuuq@invalid.net>
wrote:
>> Which one is line 16?
>>
>> Please create a much more descriptive and precise subject line.
>Are you dumb?
>
>> Please read and act on the information here:
>> http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
>Jesus balls. Line 16 from the top. Shebang is number one.
Yep: it requires all of us who want to help to either:
(i) count manually;
(ii) write a oneliner to print line numbers or
(iii) modify and run your script.
Some of these may be lightweight enough, but get multiplied by the
number of interested persons. Had you siply marked that line with a
comment, you have maximally helped people to help you.
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: Thu, 04 Oct 2007 13:33:39 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: line 16
Message-Id: <jpj9g3ddm0n6c3tfgt06rra7p2ksvrtob0@4ax.com>
On Wed, 3 Oct 2007 16:21:51 -0700, Keith Keller
<kkeller-usenet@wombat.san-francisco.ca.us> wrote:
>>> Please create a much more descriptive and precise subject line.
>> Are you dumb?
>
>Who is more dumb, the dumb or the dumb asking other dumb people questions?
:) See <http://perlmonks.org/?node_id=637052> and in particular the
third option.
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: Thu, 04 Oct 2007 13:34:24 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: line 16
Message-Id: <ftj9g3dh0rsdtrdjg1i53jasn9alo39fs1@4ax.com>
On Wed, 03 Oct 2007 20:21:00 -0500, "Mumia W."
<paduille.4061.mumia.w+nospam@earthlink.net> wrote:
>To answer your question Wade, evidently NEWNEWS is not supported by
>newsgroups.comcast.net. I tried your program with three free news
>servers, and only one of them supported NEWNEWS.
Incidentally, he's been told so months ago already.
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: Thu, 04 Oct 2007 12:15:49 -0000
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Odd regex behavior
Message-Id: <1191500149.315567.119980@w3g2000hsg.googlegroups.com>
On Oct 3, 2:14 am, s...@netherlands.co wrote:
> On Tue, 02 Oct 2007 16:51:17 -0000, Brian McCauley <nobul...@gmail.com> wrote:
> >'From outside loop' =~ /(.*)/;
>
> >for my $pass ( 1, 2 ) {
> > print "$1\n";
> > 'From later inside loop' =~ /(.*)/;
> >}
> >__END__
>
> >The above could reasonably be expected to print 'From outside loop'
> >twice but actually prints 'From later inside loop' the second time.
> I'm a little unsure of the logic. In your loop, you do a regex behind
> the print $1.
Yes, that's the whole point.
> Wouldn't you expect the result from the last regex?
No I'd expect the result from the last regex excluding those from
dynamic scopes that have now ended. On the second iteration of the
loop the dynamic scope from the first iteration has ended so I should
not see the result of the regex.
> If regex finally has "scope", you should expect garbage or unreliable results
> in the first pass.
No, it is defined that if there has been no successful regex match in
the current dynamic scope then the parent dynamic scope is examined.
This is usual for dynamic scopes.
> The for { } is scope, the second pass prints the inside.
Yes, this is the bug I'm reporting.
> Probably, the $_ should clear the $n variables though, can't remember if it
> does.
$_ is not involved anywhere in my example.
> I didn't try your code.
I did.
------------------------------
Date: Thu, 04 Oct 2007 14:54:26 -0000
From: Jack <jack_posemsky@yahoo.com>
Subject: perl join on a non printable variable character ?
Message-Id: <1191509666.771886.239810@19g2000hsx.googlegroups.com>
Hi I am trying to join on decimal 28, or \034 the non printable field
delimiter. I cant get this to work.. any help would be great ..
assume $delimiter is passed in as \034
works:
@temparray = split(/$delimiter/, $_);
@temparray = split(/\034/, $_);
print OUTFILE1 join("\034",$rowcounter,$_)."\n";
this doesnt work :
print OUTFILE1 join("$delimiter",$rowcounter,$_)."\n";
print OUTFILE1 join("\$delimiter",$rowcounter,$_)."\n";
print OUTFILE1 join($delimiter,$rowcounter,$_)."\n";
print OUTFILE1 join($$delimiter,$rowcounter,$_)."\n";
or any variation of above ...
------------------------------
Date: Thu, 04 Oct 2007 08:06:04 -0700
From: Mintcake <tony@skelding.co.uk>
Subject: Re: perl join on a non printable variable character ?
Message-Id: <1191510364.422151.23180@22g2000hsm.googlegroups.com>
On Oct 4, 9:54 pm, Jack <jack_posem...@yahoo.com> wrote:
> Hi I am trying to join on decimal 28, or \034 the non printable field
> delimiter. I cant get this to work.. any help would be great ..
>
> assume $delimiter is passed in as \034
>
> works:
> @temparray = split(/$delimiter/, $_);
> @temparray = split(/\034/, $_);
> print OUTFILE1 join("\034",$rowcounter,$_)."\n";
>
> this doesnt work :
> print OUTFILE1 join("$delimiter",$rowcounter,$_)."\n";
> print OUTFILE1 join("\$delimiter",$rowcounter,$_)."\n";
> print OUTFILE1 join($delimiter,$rowcounter,$_)."\n";
> print OUTFILE1 join($$delimiter,$rowcounter,$_)."\n";
> or any variation of above ...
So, in the bit that allegedly works, the value of $delimiter (passed
in but we don't see how) is totally ignored. I'd like to see the sub
call and sub declaration.
------------------------------
Date: Thu, 4 Oct 2007 12:57:03 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: SIG{'PIPE'}
Message-Id: <f11ft4-bk1.ln1@osiris.mauzo.dyndns.org>
Quoth "Petr Vileta" <stoupa@practisoft.cz>:
> I wrote some script to grab web pages, parse and store data to MySQL
> database. On my local PC script work fine but on hosting server many times
> fail for ungnown reason. So I write this to script
>
> $SIG{'QUIT'}=sub {errexit("SIG-QUIT");};
> $SIG{'TERM'}=sub {errexit("SIG-TERM")};
> $SIG{'PIPE'}=sub {errexit("SIG-PIPE")};
> $SIG{'__DIE__'}=sub {errexit("SIG-DIE")};
>
> where errxit() is my function to write text to log file and exit. Now I know
> that script fail for SIG{'PIPE'} but I don't know why. For get webpage I use
> LWP module and I get from 20 to 50 pages before SIG{'PIPE'} terminate my
> script.
> Can anybody describe me in which cases SIG{'PIPE'} can occur?
SIGPIPE is sent if you attempt to write to a pipe which has been closed.
'Pipe' here includes SOCK_STREAM sockets, at least on some systems. If
you ignore SIGPIPE ($SIG{PIPE} = 'IGNORE';) then instead of the signal
the write will fail with EPIPE.
A wild guess: is this a CGI script, and the browser is timing out the
request before you've finished, so you get a SIGPIPE trying to write to
STDOUT?
Ben
------------------------------
Date: Thu, 04 Oct 2007 09:30:13 -0400
From: Lew <lew@lewscanon.com>
Subject: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <LbOdnTQO_ph7d5nanZ2dnUVZ_tOtnZ2d@comcast.com>
Tim X wrote:
> "The Americans are identical to the British in all respects except, of
> course, language." Oscar Wilde
> "We (the British and Americans) are two countries separated by a common
> language. G.B. Shaw
> There is a well-known saying: Two nations separated by a common language. However, this phrase doesn't seem to have been positively recorded in this form by anyone.
>
> In The Canterville Ghost Oscar Wilde wrote:
>
> /We have really everything in common with America nowadays except, of course, language/
>
> In a 1951 book of quotations, and without attributing a source, George Bernard Shaw was credited with saying:
>
> /England and America are two countries separated by the same language/
>
> Even Dylan Thomas had his say in a radio talk in the early 50s:
>
> /[European writers and scholars in America are] up against the barrier of a common language/
>
> But where the original phrase came from, nobody knows, and it is probably simply incorrectly quoted.
<http://yedda.com/questions/origin_famous_sentence_quotations_8625651351715/>
--
Lew
------------------------------
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 905
**************************************