[31451] in Perl-Users-Digest
Perl-Users Digest, Issue: 2703 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 2 18:09:43 2009
Date: Wed, 2 Dec 2009 15:09:08 -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, 2 Dec 2009 Volume: 11 Number: 2703
Today's topics:
Re: Failed connection to sftp server via Net::SFTP <se5u0o702@sneakemail.com>
Re: FAQ 3.4 How do I find which modules are installed o <sysadmin@example.com>
Re: FAQ 3.4 How do I find which modules are installed o <justin.0911@purestblue.com>
Re: FAQ 3.4 How do I find which modules are installed o <brian.d.foy@gmail.com>
Re: FAQ 3.4 How do I find which modules are installed o <brian.d.foy@gmail.com>
Re: FAQ 3.4 How do I find which modules are installed o <brian.d.foy@gmail.com>
Re: FAQ 3.4 How do I find which modules are installed o <sysadmin@example.com>
Re: Good Golly Miss Molly Perl. Been so long. (aka ? the Platypus)
Re: Good Golly Miss Molly Perl. Been so long. <uri@StemSystems.com>
Re: Good Golly Miss Molly Perl. Been so long. <rvtol+usenet@xs4all.nl>
Re: Good Golly Miss Molly Perl. Been so long. <m@rtij.nl.invlalid>
i18n? <ams@sister.ludd.luth.se>
Re: i18n? <newsojo@web.de>
Re: i18n? <ben@morrow.me.uk>
Re: i18n? <klaus03@gmail.com>
Re: Import Module/Function - Undefined subroutine (aka ? the Platypus)
Re: the uninitialized variable that wasn't (Alan Curry)
Re: the uninitialized variable that wasn't <john@castleamber.com>
Re: the uninitialized variable that wasn't <ben@morrow.me.uk>
Re: the uninitialized variable that wasn't <whynot@pozharski.name>
Re: Using CGI::Cookie <waveright@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 1 Dec 2009 13:15:07 -0800 (PST)
From: Kevin13 <se5u0o702@sneakemail.com>
Subject: Re: Failed connection to sftp server via Net::SFTP
Message-Id: <8bce3588-7acd-45a8-bdb3-ba5569af04a4@c34g2000yqn.googlegroups.com>
Okay, if anyone else should run into a similar situation, look to the
version of perl that you're using and/or the versions of the specific
modules installed.
For example in this case the issue was the use of perl package
"Net::SSH::Perl" (which underlies "Net::SFTP"). In our installation
the former module was version 1:24. Versions 1:30 and later were
proved to work properly. (Yes, we should keep our perl installation
up to date. Not something I have any control over.)
The folks at the other end had been upgrading the software
configuration on their sftp server which evidently suddenly caused our
code to fail. Here's a little more:
"The failure consistently happens when channel 0 of the SSH dialogue
receives an end-of-file and the failure does not happen if the user
has the shell set to /usr/bin/ssh-dummy-shell, as was used with the
pre-upgrade Reflections SSH, rather than the /usr/bin/false now
employed for security reasons with the upgraded version."
Hope this helps.
------------------------------
Date: Tue, 01 Dec 2009 14:38:22 -0800
From: Wanna-Be Sys Admin <sysadmin@example.com>
Subject: Re: FAQ 3.4 How do I find which modules are installed on my system?
Message-Id: <yVgRm.33165$Sw5.28951@newsfe16.iad>
brian d foy wrote:
> In article <41a8.4b13e01e.4ed90@zem>, Justin C
> <justin.0911@purestblue.com> wrote:
>
>> On 2009-11-29, PerlFAQ Server <brian@theperlreview.com> wrote:
>
>> > 3.4: How do I find which modules are installed on my system?
>
>> > From the command line, you can use the "cpan" command's "-l"
>> > switch:
>> >
>> > $ cpan -l
>
>> justin@zem:~$ cpan -l
>> Unknown option: l
>> Nothing to install!
>
> Use the latest version of cpan. :)
Same error here (1.9402) as well as older versions (I don't recall what
version it (1.7601, I believe?) was before the upgrade earlier, but
same error with current). On other systems 1.9304 also fails, so I
stopped checking.
--
Not really a wanna-be, but I don't know everything.
------------------------------
Date: Wed, 02 Dec 2009 09:18:33 -0000
From: Justin C <justin.0911@purestblue.com>
Subject: Re: FAQ 3.4 How do I find which modules are installed on my system?
Message-Id: <481a.4b1630e9.bf119@zem>
On 2009-12-01, brian d foy <brian.d.foy@gmail.com> wrote:
> In article <41a8.4b13e01e.4ed90@zem>, Justin C
><justin.0911@purestblue.com> wrote:
>
>> On 2009-11-29, PerlFAQ Server <brian@theperlreview.com> wrote:
>
>> > 3.4: How do I find which modules are installed on my system?
>
>> > From the command line, you can use the "cpan" command's "-l" switch:
>> >
>> > $ cpan -l
>
>> justin@zem:~$ cpan -l
>> Unknown option: l
>> Nothing to install!
>
> Use the latest version of cpan. :)
cpan[1]> upgrade cpan
All modules are up to date for CPAN
zem:~# cpan -v
/usr/local/bin/cpan script version 1.9, CPAN.pm version 1.9402
Is the mirror I'm using out of date? What is the latest version number?
Justin.
--
Justin C, by the sea.
------------------------------
Date: Wed, 02 Dec 2009 15:58:22 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 3.4 How do I find which modules are installed on my system?
Message-Id: <021220091558221403%brian.d.foy@gmail.com>
[[ This message was both posted and mailed: see
the "To," "Cc," and "Newsgroups" headers for details. ]]
In article <011220090949292601%jimsgibson@gmail.com>, Jim Gibson
<jimsgibson@gmail.com> wrote:
> In article <011220091115380337%brian.d.foy@gmail.com>, brian d foy
> <brian.d.foy@gmail.com> wrote:
> > > > From the command line, you can use the "cpan" command's "-l" switch:
> > > >
> > > > $ cpan -l
> > Use the latest version of cpan. :)
>
> I get the same thing using CPAN 1.9402 with Perl 5.10.1 under Mac OS
> 10.6.2 :(
That's a pretty old version of cpan(1). Get the latest one. It's either
the cpan-script distro, or the new App::Cpan packaging.
------------------------------
Date: Wed, 02 Dec 2009 15:59:16 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 3.4 How do I find which modules are installed on my system?
Message-Id: <021220091559164632%brian.d.foy@gmail.com>
In article <yVgRm.33165$Sw5.28951@newsfe16.iad>, Wanna-Be Sys Admin
<sysadmin@example.com> wrote:
> brian d foy wrote:
> > Use the latest version of cpan. :)
>
> Same error here (1.9402) as well as older versions
You're not using the latest cpan(1) script. The one that comes with
CPAN.pm is old.
------------------------------
Date: Wed, 02 Dec 2009 16:00:02 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 3.4 How do I find which modules are installed on my system?
Message-Id: <021220091600027351%brian.d.foy@gmail.com>
In article <481a.4b1630e9.bf119@zem>, Justin C
<justin.0911@purestblue.com> wrote:
> zem:~# cpan -v
> /usr/local/bin/cpan script version 1.9, CPAN.pm version 1.9402
>
> Is the mirror I'm using out of date? What is the latest version number?
It's the cpan-script or App::Cpan module. The one that comes with
CPAN.pm is old.
------------------------------
Date: Wed, 02 Dec 2009 14:54:45 -0800
From: Wanna-Be Sys Admin <sysadmin@example.com>
Subject: Re: FAQ 3.4 How do I find which modules are installed on my system?
Message-Id: <VeCRm.35131$kY2.35063@newsfe01.iad>
brian d foy wrote:
> In article <yVgRm.33165$Sw5.28951@newsfe16.iad>, Wanna-Be Sys Admin
> <sysadmin@example.com> wrote:
>
>> brian d foy wrote:
>
>> > Use the latest version of cpan. :)
>>
>> Same error here (1.9402) as well as older versions
>
> You're not using the latest cpan(1) script. The one that comes with
> CPAN.pm is old.
I see, I was just doing the CPAN::Bundle update with that was there on
all of my systems. That must explain it (I had just assumed it would
be the newest).
--
Not really a wanna-be, but I don't know everything.
------------------------------
Date: 02 Dec 2009 06:03:56 GMT
From: "David Formosa (aka ? the Platypus)" <dformosa@usyd.edu.au>
Subject: Re: Good Golly Miss Molly Perl. Been so long.
Message-Id: <009f87cd$0$26914$c3e8da3@news.astraweb.com>
On Thu, 26 Nov 2009 10:08:43 -0500, Shmuel Metz <spamtrap@library.lspace.org.invalid> wrote:
[...]
> There's nothing wrong with goto when used properly. Like any tool, it can
> be and often is misused, but it's useful in its place.
Can you give an example of perl code where it would be better to use a goto (excluding
magic goto).
------------------------------
Date: Wed, 02 Dec 2009 01:46:25 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Good Golly Miss Molly Perl. Been so long.
Message-Id: <87eindan5q.fsf@quad.sysarch.com>
>>>>> "DF" == David Formosa (aka ? the Platypus) <dformosa@usyd.edu.au> writes:
DF> On Thu, 26 Nov 2009 10:08:43 -0500, Shmuel Metz <spamtrap@library.lspace.org.invalid> wrote:
DF> [...]
>> There's nothing wrong with goto when used properly. Like any tool, it can
>> be and often is misused, but it's useful in its place.
DF> Can you give an example of perl code where it would be better to
DF> use a goto (excluding magic goto).
in lesser langs which don't have the flexible flow control that perl
has, you would use a goto to exit from several places into the same exit
handling code in a sub. i have even seen this done on cpan by quality
coders but goto doesn't ever need to be used like that. if you design
your flow well, you can exit a sub or block early instead and handle
flow that way which is a clean style. the key is seeing the different
ways you can flow your code and choosing the best one instead of the
first one you get. this is often what i see in poor code, a first choice
instead of thinking more and making a better choice.
rule: your code is the recorded history of your logical choices when
designing the program.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 02 Dec 2009 20:58:36 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Good Golly Miss Molly Perl. Been so long.
Message-Id: <4b16c6ed$0$22938$e4fe514c@news.xs4all.nl>
Shmuel (Seymour J.) Metz wrote:
> David Formosa:
>> Can you give an example of perl code where it would be better to use a
>> goto (excluding magic goto).
>
> I haven't run into a case where I needed a goto in Perl, but that doesn't
> mean that there aren't cases where it is useful. I'd certainly want any
> use of goto to include a comment as to why the specific use was
> appropriate.
Idem labels.
--
Ruud
------------------------------
Date: Wed, 2 Dec 2009 22:01:09 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Good Golly Miss Molly Perl. Been so long.
Message-Id: <l51ju6-9le.ln1@news.rtij.nl>
On Wed, 02 Dec 2009 20:58:36 +0100, Dr.Ruud wrote:
> Shmuel (Seymour J.) Metz wrote:
>
>> I haven't run into a case where I needed a goto in Perl, but that
>> doesn't mean that there aren't cases where it is useful. I'd certainly
>> want any use of goto to include a comment as to why the specific use
>> was appropriate.
>
> Idem labels.
Breaking out of multi level loops with next or last does not warrant such
a comment imho. Obviously, the label names should be documentative.
M4
------------------------------
Date: Wed, 2 Dec 2009 10:52:08 +0000 (UTC)
From: Martin Str|mberg <ams@sister.ludd.luth.se>
Subject: i18n?
Message-Id: <hf5gso$lpt$1@aioe.org>
I've been looking for i18n for perl so that I can't get error messages
in Swedish. I haven't found anything, not _any_ other language.
Is there no such thing? Or have I just searched the wrong places or
for the wrong things?
--
MartinS
------------------------------
Date: 02 Dec 2009 12:45:53 GMT
From: Oliver 'ojo' Bedford <newsojo@web.de>
Subject: Re: i18n?
Message-Id: <4b166181$0$6556$9b4e6d93@newsspool4.arcor-online.net>
Am Wed, 02 Dec 2009 10:52:08 +0000 schrieb Martin Str|mberg:
> I've been looking for i18n for perl so that I can't get error messages
> in Swedish. I haven't found anything, not _any_ other language.
>
> Is there no such thing? Or have I just searched the wrong places or for
> the wrong things?
I haven't really thought about it, but do you think that this would
be a good thing?
The application should be localised, so the user can easily understand
the error message. But for the programming language itself, I find it
more important to be able to search the web
(or any other source) for the literal message to get further help.
Besides I would consider english nowadays as the lingua franca for
science and technology.
Sorry for not being really helpful.
Oliver
------------------------------
Date: Wed, 2 Dec 2009 14:04:48 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: i18n?
Message-Id: <0p8iu6-2v7.ln1@osiris.mauzo.dyndns.org>
Quoth Martin Str|mberg <ams@sister.ludd.luth.se>:
> I've been looking for i18n for perl so that I can't get error messages
> in Swedish. I haven't found anything, not _any_ other language.
>
> Is there no such thing? Or have I just searched the wrong places or
> for the wrong things?
Which messages are you talking about? Those generated by perl itself
cannot be localised. There has been some discussion of the possibility
in the past, but (among other things) there's just too much code out
there that does regex matching on $@ for this to be very practical
(start with diagnostics.pm, for instance). Most modules don't provide
localized error messages either.
The string value of $!, OTOH, should be localised, though you may need
to call POSIX::setlocale.
Ben
------------------------------
Date: Wed, 2 Dec 2009 11:57:59 -0800 (PST)
From: Klaus <klaus03@gmail.com>
Subject: Re: i18n?
Message-Id: <d18e8fd3-7595-4a41-a6da-ed7115cfe9de@d21g2000yqn.googlegroups.com>
On 2 d=E9c, 11:52, Martin Str|mberg <a...@sister.ludd.luth.se> wrote:
> I've been looking for i18n for perl so that I can't get error messages
> in Swedish. I haven't found anything, not _any_ other language.
>
> Is there no such thing? Or have I just searched the wrong places or
> for the wrong things?
Have you looked on CPAN ?
http://search.cpan.org/~audreyt/i18n-0.10/lib/i18n.pm
-- Klaus
------------------------------
Date: 02 Dec 2009 06:31:21 GMT
From: "David Formosa (aka ? the Platypus)" <dformosa@usyd.edu.au>
Subject: Re: Import Module/Function - Undefined subroutine
Message-Id: <009f8e3a$0$26907$c3e8da3@news.astraweb.com>
On Mon, 30 Nov 2009 08:53:32 -0800 (PST), Axel <axel.christiansen@gmx.de> wrote:
> Dear All!
>
>
> Since quite a while i am having pain with a module import issue.
>
> Here i post 2 examples from which the first does not work.
> It would be very nice if one could explain, why my first example
> does not work. What do i need to do getting it working?
You have mutually recursive modules. (That is A uses B which uses A). Perl can run into
problems in situations like this. Best advice is to refactor your code so you don't have
a loop like this.
------------------------------
Date: Tue, 1 Dec 2009 23:39:58 +0000 (UTC)
From: pacman@kosh.dhis.org (Alan Curry)
Subject: Re: the uninitialized variable that wasn't
Message-Id: <hf49ge$8lm$1@aioe.org>
In article <87vdgqqz6m.fsf@castleamber.com>,
John Bokma <john@castleamber.com> wrote:
>pacman@kosh.dhis.org (Alan Curry) writes:
>
>>
>> (And that's how verbose it is after stripping the HTML tags.) Notice
>> how it uses 68 words to give no reason at all. You can guess the
>> reason, and I can too.
>
>This has nothing to do with perlbug.
It was the end of a chain of error messages I followed diligently after
trying to use perlbug. There may have been other paths through the maze that
wouldn't have led to the same dead-end, but I refuse to enter this game of
guessing what software someone out there doesn't want me to use. None of my
choices were in violation of the relevant protocols. (Perhaps one might think
of "User-Agent: Mozilla" as a mandatory part of HTTP, since failing to
provide it leads to all kinds of crappy behavior, making this a bug in LWP.)
>
>> And I did know all this before I posted the first message in this
>> thread. It's not that I didn't try to do a bug report through
>> official channels, it's that I tried and it was rejected.
>
>Yup, rejected by how your ISP choses to run things, IMO. There is a
>reason that they are on a list by policy.
That I'm on the Internet at all is probably a violation of some policy since
I'm not a Windoze user. None of Comcast's software configuration advice
would be applicable to me, if I could actually read it.
>
>The amusing part is that you made two wrong assumptions and blame the
>wrong party. Sounds now less smart, no?
I've been doing this mail over dynamic DNS for a while now and so far, perl
is the only thing I haven't been able to send bug reports to. And I really
don't have any idea where the relay would be if I wanted to use it. Which I
don't. I've been against the idea of the mandatory relaying policy since it
came to my attention with the introduction of MAPS DUL long ago. I know
exactly what's going on, I know why people have made the decisions they've
made, including the ones I disagree with, since I watched it all as it was
happening. The mail system is fragmented now. It was too good to last.
--
Alan Curry
------------------------------
Date: Tue, 01 Dec 2009 18:33:12 -0600
From: John Bokma <john@castleamber.com>
Subject: Re: the uninitialized variable that wasn't
Message-Id: <87hbsa8bav.fsf@castleamber.com>
pacman@kosh.dhis.org (Alan Curry) writes:
> guessing what software someone out there doesn't want me to use. None of my
> choices were in violation of the relevant protocols. (Perhaps one might think
> of "User-Agent: Mozilla" as a mandatory part of HTTP, since failing to
> provide it leads to all kinds of crappy behavior, making this a bug in
> LWP.)
You're to easy to blame the wrong program/library.
LWP is a HTTP client and I think it's correct if it sets it own HTTP
header instead of pretending to be something it clearly isn't. Moreover,
assuming you use bash (but I am sure other shells have similar
abilities) it's a piece of cake to create an alias which sets the
User-Agent header for you if you insist on reading HTML in your terminal.
John
------------------------------
Date: Wed, 2 Dec 2009 08:09:05 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: the uninitialized variable that wasn't
Message-Id: <1ujhu6-qd6.ln1@osiris.mauzo.dyndns.org>
Quoth John Bokma <john@castleamber.com>:
> pacman@kosh.dhis.org (Alan Curry) writes:
>
> > guessing what software someone out there doesn't want me to use. None of my
> > choices were in violation of the relevant protocols. (Perhaps one might think
> > of "User-Agent: Mozilla" as a mandatory part of HTTP, since failing to
> > provide it leads to all kinds of crappy behavior, making this a bug in
> > LWP.)
>
> You're to easy to blame the wrong program/library.
Please take this discussion elsewhere.
Ben
------------------------------
Date: Wed, 02 Dec 2009 09:40:31 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: the uninitialized variable that wasn't
Message-Id: <slrnhhc6fe.j63.whynot@orphan.zombinet>
On 2009-12-01, John Bokma <john@castleamber.com> wrote:
> pacman@kosh.dhis.org (Alan Curry) writes:
>
>> $ perl -we 'my $v = 12345; my $str = sprintf "%06x\n". $v;'
>> Use of uninitialized value $v in sprintf at -e line 1.
>
> Additionally, if you make $v undef you get:
>
> Use of uninitialized value $x in concatenation (.) or string at -e line 1.
> Use of uninitialized value $x in printf at -e line 1.
>
> perl, v5.10.0 built for x86_64-linux-gnu-thread-multi
or
{1230:2} [0:0]% perl -wle 'my $v = 15; my $str = sprintf "%06x\n" . $v;'
Use of uninitialized value $v in sprintf at -e line 1.
{1934:3} [0:0]% perl -wle 'my $v = 15; my $str = sprintf "%06x\n" , $v;'
{1939:4} [0:0]% perl -wle 'my $v = 15; my $str = sprintf "%06x\n" . $v , undef'
Use of uninitialized value in sprintf at -e line 1.
when copy-paste sux.
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: Tue, 1 Dec 2009 20:32:54 -0800 (PST)
From: Todd Wade <waveright@gmail.com>
Subject: Re: Using CGI::Cookie
Message-Id: <204ed38c-ca35-496a-bfbc-05d90a19454b@9g2000yqa.googlegroups.com>
On Nov 28, 8:55=A0pm, Jason Carlton <jwcarl...@gmail.com> wrote:
> For CGI::Cookie, Cpan states:
>
> The simplest way to send a cookie to the browser is by calling the bake
> () method:
> =A0 $c->bake;
>
> If you want to set the cookie yourself, Within a CGI script you can
> send a cookie to the browser by creating one or more Set-Cookie:
> fields in the HTTP header. Here is a typical sequence:
>
> =A0 my $c =3D new CGI::Cookie(-name =A0 =A0=3D> =A0'foo',
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -value =A0 =3D> =A0['=
bar','baz'],
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -expires =3D> =A0'+3M=
');
>
> =A0 print "Set-Cookie: $c\n";
> =A0 print "Content-Type: text/html\n\n";
>
> When should I use "bake", and when should I simply use "Set-Cookie"?
> Is there an advantage or disadvantage either way?
This is an excellently formatted question! But a peek at the source
will probably answer the question easily for you:
http://cpansearch.perl.org/src/LDS/CGI.pm-3.48/lib/CGI/Cookie.pm
It looks like one may want to use bake for a couple different reasons.
Possibly for consiseness in the client code, or where the code may be
used in different environments (CGI and mod_perl in particular).
trwww
------------------------------
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 2703
***************************************