[25038] in Perl-Users-Digest
Perl-Users Digest, Issue: 7288 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 22 18:05:47 2004
Date: Fri, 22 Oct 2004 15:05:10 -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 Fri, 22 Oct 2004 Volume: 10 Number: 7288
Today's topics:
Re: case INsensitive regular expressions <matthew.garrish@sympatico.ca>
Gtk2::TreeView <mail.david@dsl.pipex.com>
Re: Gtk2::TreeView <mail.david@dsl.pipex.com>
how to become a perl hacker? <doug@doug.com>
How to become a perl hacker? <doug@yahoo.com>
Re: How to become a perl hacker? <uguttman@athenahealth.com>
Re: How to redefine warnings on recursion level <abigail@abigail.nl>
Re: How to redefine warnings on recursion level <Jon.Ericson@jpl.nasa.gov>
Re: list vs array <nospam@nospam.com>
Re: list vs array <noreply@gunnar.cc>
Re: list vs array <mritty@gmail.com>
Re: list vs array <jgibson@mail.arc.nasa.gov>
Re: list vs array <nospam@nospam.com>
Re: list vs array <usa1@llenroc.ude.invalid>
Re: list vs array <nospam@nospam.com>
Re: list vs array <usa1@llenroc.ude.invalid>
Re: list vs array <doug@yahoo.com>
Re: list vs array <nospam@nospam.com>
Re: list vs array <nospam@nospam.com>
Re: list vs array (Randal L. Schwartz)
Re: Online forum source codes in Perl/CGI without SQL? <ebohlman@omsdev.com>
Re: printing to web browser <jwkenne@attglobal.net>
Re: printing to web browser <usenet@morrow.me.uk>
printLDIF wraps long lines of text (Mike)
Re: Remote Permissions Problem <Jon.Ericson@jpl.nasa.gov>
Saving attachments from emails (Jules Mitland)
Re: Saving attachments from emails <usa1@llenroc.ude.invalid>
Re: Understanding of *$self <xx087@freenet.carleton.ca>
Re: Understanding of *$self <nospam-abuse@ilyaz.org>
Re: using range gives warning <gifford@umich.edu>
Re: using range gives warning <usa1@llenroc.ude.invalid>
Re: using range gives warning <dwall@fastmail.fm>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 22 Oct 2004 17:10:26 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: case INsensitive regular expressions
Message-Id: <2Heed.59435$JG5.1008798@news20.bellglobal.com>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:nT1ed.12744$n81.3370@trnddc08...
> sabinosa wrote:
>> I am working with a RegularExpressionValidator in Visual Studio.NET.
>
> Interesting! I didn't know that Visual Studio.NET supports Perl. I guess
> there is always something new to learn.
>
It's not nearly as impressive as it might sound. I would go with C# if you
have to go the MS application/aspx route (although I only used the Perl
extension for a while under the trial license). The only advantage I've
found to .Net is that it makes other languages more Perlish (although still
in a cramped and painful way), but it just gets in the way of Perl (i.e.,
why go through all the building, matching and capturing involved in using
the RegularExpressions class when Perl makes it so ridiculously easy). If
you really need Perl in an ASPX environment, though, I guess there's no
other option...
>
>> The error says: "Syntax error in
>> regular expression"
>> (^(CSV|ZIP|TXT)$/i does not work)
>
> At least the trailing /i is the correct syntax.
In Perl, yes. In .Net, probably not. .Net has an ugly, verbose way of OR'ing
modifiers. For example:
Regex myPattern = new Regex(@"^(CSV|ZIP|TXT)$", RegexOptions.Multiline |
RegexOptions.IgnoreCase);
But then again, this is really getting off-topic for this group...
Matt
------------------------------
Date: Fri, 22 Oct 2004 22:24:53 +0000
From: David Green <mail.david@dsl.pipex.com>
Subject: Gtk2::TreeView
Message-Id: <pan.2004.10.22.22.24.53.57087@dsl.pipex.com>
Hey,
I've got a problem getting gtk2's tree-view widget to work, not helped by
the fact the widget is undocumented in the GTK2 api. I can't seem to
decipher the perl bindings for it either.
What I'd like to do is create a tree-structure, ie
Fruit
|
|------Apples
|----Granny Smith
|----Old English
|------Pears
|------Tomatoes
I'm aware I need to use a tree store,
--
David Green (mail.david@dsl.pipex.com)
Hands up for human rights!
http://www.amnesty.org
------------------------------
Date: Fri, 22 Oct 2004 22:33:40 +0000
From: David Green <mail.david@dsl.pipex.com>
Subject: Re: Gtk2::TreeView
Message-Id: <pan.2004.10.22.22.33.39.806246@dsl.pipex.com>
(appologies for multipart)
> I'm aware I need to use a tree store,
# Define a tree store to expect two strings
my $tree_store = new Gtk2::TreeStore ("Glib::String", "Glib::String");
# Create the first empty row
my $iter = $tree_store->append (undef);
# Add the row
$tree_store->set_value ($iter, "0", "A string", "1", "Some other string");
# ... <snip> more rows added via above method
# Bind the model to the treeView
my $tree_view = new Gtk2::TreeView($tree_store);
I then add the treeview to a container (HBox) and a get a white box with
no content - I've tried various possibilities for set_value but still
accept I could be wholly wrong here?
What am I doing wrong or can anyone suggest any further documentation?
With thanks,
Dave
--
David Green (mail.david@dsl.pipex.com)
Hands up for human rights!
http://www.amnesty.org
------------------------------
Date: Fri, 22 Oct 2004 14:37:08 -0400
From: doug <doug@doug.com>
Subject: how to become a perl hacker?
Message-Id: <10nil0pnqdoic00@news.supernews.com>
#! /usr/bin/perl
@whatdoIhaveto = <STDIN>;
do
{
$I = shift @whatdoIhaveto;
} until $I =~ /a perl hacker/i;
--
doug
------------------------------
Date: Fri, 22 Oct 2004 14:40:42 -0400
From: doug <doug@yahoo.com>
Subject: How to become a perl hacker?
Message-Id: <10nil7g5fpqoaac@news.supernews.com>
#! /usr/bin/perl
@whatdoIhaveto = <STDIN>;
do
{
        $I = shift @whatdoIhaveto;
} until $I =~ /a perl hacker/i;
--
doug
------------------------------
Date: Fri, 22 Oct 2004 15:01:43 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: How to become a perl hacker?
Message-Id: <m3breu60h4.fsf@linux.local>
>>>>> "d" == doug <doug@yahoo.com> writes:
d> #! /usr/bin/perl
d> @whatdoIhaveto = <STDIN>;
d> do
d> {
d>         $I = shift @whatdoIhaveto;
d> } until $I =~ /a perl hacker/i;
print "don't post stupid stuff\n" while 1 ;
uri
------------------------------
Date: 22 Oct 2004 21:43:13 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How to redefine warnings on recursion level
Message-Id: <slrncnivnh.3ac.abigail@alexandra.abigail.nl>
Jon Ericson (Jon.Ericson@jpl.nasa.gov) wrote on MMMMLXIX September
MCMXCIII in <URL:news:rcg3c071viw.fsf@Jon-Ericson.sdsio.prv>:
-: "Paul Lalli" <mritty@gmail.com> writes:
-:
-: > I think the question has to be asked - why are you doing this? If this
-: > was just a sample to show us the warning message, that's fine. But if
-: > this is how you're actually calculating a factoral (which is the
-: > mathematical term for what you're doing - not "faculty"), have you
-: > considered an iterative algorithm instead?
-: >
-: > my $fact = 1;
-: > $fact *= $_ for (1..100);
-: ^ 2 saves a cycle here.
-: > print "100! = $fact\n";
-:
-: Depending on how often a script calculates factorial, it's possible a
-: memoized recursive algorithm would be a win. Consider 100! - 98!, for
-: instance.
my $sum = 100 * 98;
$sum *= $_ for 2 .. 98;
Abigail
--
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_;
sub _ {push @_ => /::(.*)/s and goto &{ shift}}
sub shift {print shift; @_ and goto &{+shift}}
Hack ("Just", "Perl ", " ano", "er\n", "ther "); # 20041022
------------------------------
Date: Fri, 22 Oct 2004 14:17:35 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: How to redefine warnings on recursion level
Message-Id: <rcg6552zc40.fsf@Jon-Ericson.sdsio.prv>
notruf_1102003@yahoo.de (Gerhard M) writes:
> "Paul Lalli" <mritty@gmail.com> wrote in message news:<YPSdd.3818$EL5.1324@trndny09>...
>>
>> [Have] you considered an iterative algorithm instead?
>>
> Yes, i've thougt about it. Thats my code:
>
> %all=();
> ...
> sub insert ($$$) {
> my ($key,$data;$cnt)=@_;
> if (defined $all{$_[0]."[".$_[2]."]"}) { # already exists
> insert($key, $data, ++$cnt);
> } else { # insert data
> $all{$_[0]."[".$_[2]."]"} = $data
> }
> }
>
> This also could be done with an iterative algorithm. The recursion was
> my first idea and it works (except the warning). It's easy to
> understand so why to change it?
I wouldn't say it's easy to understand. That looks like a really poor
candidate for a recursive function -- especially if it's called
recursively hundreds of times. For that matter, it shouldn't be done
iteratively either.
> remark:
> It's a stupid way build up "a kind of" arrays. Better it should have
> be done with something like "push (@{$all{key}}, $data)". But the
> other routines using %all are only able to handle simple variables in
> %all.
Seems like it might be worth a redesign.
Jon
------------------------------
Date: Fri, 22 Oct 2004 14:22:31 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098469374.198637@nntp.acecape.com>
>>Perl is a language. CPAN is a large collection of sofware written in that
language and
>>documentation about that language.
More of a where to go. Is www.perldoc.com that one point in the universe
from which you can go to any other point? Is it where I start. Open
community is far different from the world that I come from. There is no one
point in C. Want a library to do something? You had to search for someone
who wrote one, and see how much they wanted. Rarely with source available,
just DLLs.
------------------------------
Date: Fri, 22 Oct 2004 20:28:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: list vs array
Message-Id: <2tt26jF228d7fU1@uni-berlin.de>
daniel kaplan wrote:
> More of a where to go. Is www.perldoc.com that one point in the
> universe from which you can go to any other point? Is it where I
> start.
One starting-point if you want to *learn* Perl is
http://learn.perl.org/
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Fri, 22 Oct 2004 18:39:10 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: list vs array
Message-Id: <itced.577$Ae3.273@trndny02>
"daniel kaplan" <nospam@nospam.com> wrote in message
news:1098469374.198637@nntp.acecape.com...
> More of a where to go. Is www.perldoc.com that one point in the
universe
> from which you can go to any other point? Is it where I start. Open
> community is far different from the world that I come from. There is
no one
> point in C. Want a library to do something? You had to search for
someone
> who wrote one, and see how much they wanted. Rarely with source
available,
> just DLLs.
"Where you go" depends on what you want to do.
Do you want to read the documentation and FAQ about Perl itself? Go to
http://www.perldoc.com
Do you want to find out if someone has already written a module that
does what you want to do? Go to http://search.cpan.org
Do you want to get recommendations on how best to learn the language?
Go to http://learn.perl.org
Do you want to hire someone to write code for you? Go to
http://jobs.perl.org
Do you want help with your own code (*after* reading the docs and FAQ)?
Post here.
Paul Lalli
------------------------------
Date: Fri, 22 Oct 2004 11:42:02 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: list vs array
Message-Id: <221020041142021436%jgibson@mail.arc.nasa.gov>
In article <1098467649.587719@nntp.acecape.com>, daniel kaplan
<nospam@nospam.com> wrote:
> > There is a FAQ that exactly matches your question: "What is CPAN?"
>
> I did look, and what I got: CPAN is the Comprehensive Perl Archive Network,
> a large collection of Perl software and documentation. You can begin ......
>
> But I still don't understand the relationship. Is CPAN a subset of Perl?
CPAN is a large collection of Perl modules that can be used in Perl
programs that you write. Some of the modules will call library
functions in other languages, primarily C, but some are pure Perl. Any
module you want to use will have be installed on your system. Some
modules come preinstalled with your basic perl installation. Most
modules will come with installation procedures. Installed modules will
end up in one of the perl library directories used by your perl
executable to find stuff (try 'perl -V' to see where those are.)
There is also a CPAN module that will help you install other CPAN
modules. Try
perl -MCPAN -e shell
at a command line on a system connected to the internet, then
install Module::Name::Here
to install a module you wish to use. Then you typically put
use Module::Name::Here
at the top of your program, and you can use the functions and methods
provided by the module, and
perldoc Module::Name::Here
to read the module's documentation.
Some of the CPAN modules support object-oriented usage, some support
functional usage, and some do both.
In regard to your question about Perl shareware, Perl is free and
available for many platforms. I personally have installed perl on
Windows PC, Mac, and Linux platforms, and I am no great shakes as a
systems administrator. If I can do it, so can you. Go to www.perl.org
or www.cpan.org to find free Perl distributions for almost any
platform.
------------------------------
Date: Fri, 22 Oct 2004 15:11:08 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098472291.717903@nntp.acecape.com>
thanks!
------------------------------
Date: 22 Oct 2004 19:16:37 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: list vs array
Message-Id: <Xns958A9B67F46C4asu1cornelledu@132.236.56.8>
"daniel kaplan" <nospam@nospam.com> wrote in
news:1098466335.391321@nntp.acecape.com:
> In fact if anyone could recommend a decent Perl w/debugger shareware,
> or something with a good trial period I would appreciate it!
I found out through another post here a few days ago about EPIC
(http://e-p-i-c.sf.net/) which is a Perl mode for Eclipse (which itself is
a Java IDE). I did try it out and it seems to be decent environment. I am
not sure I am willing to give up command line and Vim integration, however.
See also http://vim.sourceforge.net/scripts/script.php?script_id=663
>> http://faq.perl.org/
> Thanks, found it, but then can I ask what CPAN is? Is there a
> relationship? Are they alternatives?
WTF? You snipped the next line in my post:
>> See also: http://faq.perl.org/perlfaq2.html#What_modules_and_ext
Did you actually read that? Are you that lazy and/or helpless that you can
follow a hyperlink to check why I might have included that particular link?
Sinan.
------------------------------
Date: Fri, 22 Oct 2004 15:34:21 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098473684.826590@nntp.acecape.com>
>>Did you actually read that? Are you that lazy and/or helpless that you can
>>follow a hyperlink to check why I might have included that particular
link?
do we actually need to start a flame war here? seriously..just stop reading
my posts if you have a problem with me!
and if you want to talk about lazy, look at your first response to my frist
post, where i had a LIST/ ARRAY question, and you just assuemd i was asking
about Net::Pop3....so who did not properly read what then?
in fact that really started this whole small flame thread, which to be
hoenst, i am sure everyone is sick of reading...
------------------------------
Date: 22 Oct 2004 19:53:23 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: list vs array
Message-Id: <Xns958AA1A338EC2asu1cornelledu@132.236.56.8>
"daniel kaplan" <nospam@nospam.com> wrote in
news:1098473684.826590@nntp.acecape.com:
> and if you want to talk about lazy, look at your first response to my
> frist post, where i had a LIST/ ARRAY question, and you just assuemd i
> was asking about Net::Pop3....so who did not properly read what then?
OK, so let's deconstruct that, shall we?
"daniel kaplan" <nospam@nospam.com> wrote in
news:1098411758.429196@nntp.acecape.com:
> so if i do
>
> $tot_list = $pop->ping($user);
The meaning of this question is not clear. It is _assumed_ when you post
here that you have read the documentation for the module you are using. The
documentation states that the first element of the list is the number of
new messages. Given that you chose to only save the number of messages from
the function call, it is natural to assume that you are interested in the
number of new messages on the server.
The sentence:
> how do i read $tot_list elements?
is non-sensical. $pop->ping($user) always returns the same number of values
whereas the number of new messages, stored in the $tot_list variable, is,
unsurprisingly, a variable. You can print the value of that variable using
print $tot_list;
but that is so obvious that your question must be something else.
Well, what is the purpose of using the Net::POP3 module? To be able to
download email messages. Hence, my deduction that you wanted to download
the new messages on the server once you found out the number of new mssages
through the ping call.
Now, being a non-native speaker and somewhat dense, I probably failed at
parsing your correctly constructed question, but no one can claim that I
did not spend the time to read your post.
On the other hand, since I am not one asking for handouts here, I can
certainly afford not to read your posts.
Sinan.
------------------------------
Date: Fri, 22 Oct 2004 16:16:25 -0400
From: doug <doug@yahoo.com>
Subject: Re: list vs array
Message-Id: <10niqqvdtbd2id9@news.supernews.com>
Gunnar Hjalmarsson wrote:
> daniel kaplan wrote:
>> More of a where to go. Is www.perldoc.com that one point in the
>> universe from which you can go to any other point? Is it where I
>> start.
>
> One starting-point if you want to *learn* Perl is
>
> http://learn.perl.org/
>
push @bookstore, 'daniel';
push @daniel_book_collection, ('learning perl','programming perl','perl
cookbook', @other_good_perl_books);
--
doug
------------------------------
Date: Fri, 22 Oct 2004 16:41:40 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098477724.865988@nntp.acecape.com>
> push @bookstore, 'daniel';
> push @daniel_book_collection, ('learning perl','programming perl','perl
> cookbook', @other_good_perl_books);
if i understand this would be that you are adding ME to the array
bookstore.....
then to the array of books i have you are adding a list of books, and an
array of books...which if i recall, flattens that array into a list, but
only for this instance of the "push" call?
------------------------------
Date: Fri, 22 Oct 2004 16:43:01 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098477805.978427@nntp.acecape.com>
> On the other hand, since I am not one asking for handouts here, I can
> certainly afford not to read your posts.
then just stop...oh, sorry, i meant exit
------------------------------
Date: 22 Oct 2004 14:37:40 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: list vs array
Message-Id: <1098481711.oRBHvw5DVNAWmsJlfM+F1g@teranews>
>>>>> "doug" == doug <doug@yahoo.com> writes:
doug> push @bookstore, 'daniel';
doug> push @daniel_book_collection, ('learning perl','programming perl','perl
doug> cookbook', @other_good_perl_books);
Not "learning perl objects references and modules" (aka "Learning Perl
volume 2")?
(sob)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 22 Oct 2004 21:06:54 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Online forum source codes in Perl/CGI without SQL?
Message-Id: <Xns958AA4ED5EDCDebohlmanomsdevcom@130.133.1.4>
"Kelvin" <thefatcat28@hotmail.com> wrote in
news:clb56l$2v3$1@reader01.singnet.com.sg:
> Is there any forum source code (open source) that doesn't use SQL
> database? My website package doesn't give me SQL service :(
Can you install DBD::SQLite locally? That provides a self-contained SQL
database manager that runs entirely in your own process space and uses
files (one per database) in your own area [1], therefore not requiring any
server-wide processes, data, or administration?
[1] As several of the PHP people have been pointing out lately, the fact
that SQLite does in fact use local files means that you have the same
security issues that you do when using plain old files for storing data;
you need to make sure that the files are in a place that doesn't
unnecessarily expose them.
------------------------------
Date: Fri, 22 Oct 2004 19:04:24 GMT
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: printing to web browser
Message-Id: <YQced.48075$YM4.16105780@news4.srv.hcvlny.cv.net>
Tad McClellan wrote:
> If it was an acronym it would have been spelled in ALL CAPS.
Actually, in the context of a man page, no, it wouldn't, because the
executable program is named "perl", not "PERL" or "Perl".
--
John W. Kennedy
"The pathetic hope that the White House will turn a Caligula into a
Marcus Aurelius is as naïve as the fear that ultimate power inevitably
corrupts."
-- James D. Barber (1930-2004).
------------------------------
Date: Fri, 22 Oct 2004 21:03:38 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: printing to web browser
Message-Id: <ql5o42-k15.ln1@osiris.mauzo.dyndns.org>
Quoth Chris Cole <ithinkiam@gmail.com>:
> On Fri, 22 Oct 2004 06:15:30 -0500, Tad McClellan wrote:
>
> > Paul Robson <autismuk@autismuk.freeserve.co.uk> wrote:
> >> On Thu, 21 Oct 2004 15:24:05 -0700, Jim Gibson wrote:
> >>
> >>> In article <1098395030.248283@nntp.acecape.com>, daniel kaplan
> >>> <nospam@nospam.com> wrote:
>
> <snip>
> >
> > Experienced Perl programmers don't spell it "PERL", because
> > it is not an acronym.
>
> I beg to differ ;-)
> From the Perl manpage:
>
> NAME
> perl - Practical Extraction and Report Language
Just 'cos the docs contradict themselves doesn't make them wrong :)
(perlfaq1 states explicitly that Perl is not an acronym).
This backronym for Perl is something of a joke, as is 'Pathologicaly
Eclectic Rubbish Lister'. See the Camel for the actual history of the
name.
Ben
--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* ben@morrow.me.uk *
------------------------------
Date: 22 Oct 2004 14:07:17 -0700
From: mike@mikeshore.com (Mike)
Subject: printLDIF wraps long lines of text
Message-Id: <d3354680.0410221307.34997edd@posting.google.com>
I am printing results from an LDAP query using the following code:
use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Entry;
my $conn = new Mozilla::LDAP::Conn($host, $port, $bindDN, $pwd);
my $entry = $conn->search($root, $scope, $filter, 0, @attrs);
while($entry) {
$entry->printLDIF();
$entry = $conn->nextEntry();
}
The code works properly, but the printLDIF() function is wrapping
lines longer than 78 characters. How do I prevent this line wrap?
Thanks.
------------------------------
Date: Fri, 22 Oct 2004 13:42:46 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Remote Permissions Problem
Message-Id: <rcgacuezdq1.fsf@Jon-Ericson.sdsio.prv>
"David Gale" <dsgSPAMFILTER@alum.dartmouth.org> writes:
> Quoth Jon Ericson <Jon.Ericson@jpl.nasa.gov>:
>> "David Gale" <dsgSPAMFILTER@alum.dartmouth.org> writes:
>>
>>> PS: I'm sure someone's going to suggest setting up ssh keys for
>>> passwordless access, but our sysadmin doesn't want to do that, since
>>> that would give anyone who managed to crack one box passwordless
>>> access to the server.
>>
>> This isn't really a perl question you know -- you're likely to get
>> better advice from an ssh or security group. I would have suggested
>> using ssh keys (which is how I've solved this sort of problem). Maybe
>> ssh-agent would help, though I haven't needed to use it myself.
> True, this aspect of it isn't specifically a perl problem. However, my
> current attempt is to use Perl::Expect; I'm just not sure how to tell if the
> process completes successfully--does expect give you access to the exit
> value of the process once its terminated? How do you access it?
I don't know anything about the Expect module, but I imagine if you
posted a self-contained example and mentioned how the results differed
from your expectations, you'd get a response from someone who does.
You could also try the mailing list for this module:
http://lists.sourceforge.net/lists/listinfo/expectperl-discuss
Personally I would think this approach is at least as hazardous as
using ssh keys.
Jon
------------------------------
Date: 22 Oct 2004 11:25:24 -0700
From: nottm@hotmail.com (Jules Mitland)
Subject: Saving attachments from emails
Message-Id: <986fea63.0410221025.7ae6373@posting.google.com>
I'm using Net::Pop3 to download emails from my POP3 server.
How do I use MIME::Base64 to decode and save any image attachments?
------------------------------
Date: 22 Oct 2004 19:30:21 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Saving attachments from emails
Message-Id: <Xns958A9DBBA973Easu1cornelledu@132.236.56.8>
nottm@hotmail.com (Jules Mitland) wrote in
news:986fea63.0410221025.7ae6373@posting.google.com:
> I'm using Net::Pop3 to download emails from my POP3 server.
>
> How do I use MIME::Base64 to decode and save any image attachments?
Use Net::POP3 to download email meesages from your POP3 server.
Then use Email::MIME to decode and save any image attachments.
http://search.cpan.org/~simon/Email-MIME-1.8/MIME.pm
Sinan.
------------------------------
Date: 22 Oct 2004 19:21:08 GMT
From: Glenn Jackman <xx087@freenet.carleton.ca>
Subject: Re: Understanding of *$self
Message-Id: <slrncnind5.63.xx087@smeagol.ncf.ca>
At 2004-10-22 09:12AM, Jim Mozley <jim.mozley@exponential-e.com> wrote:
> Knowing this might help me understand ${*$self}{hash_ref}. Does this
> mean get the value of the key hash_ref from the hash referenced by the
> scalar in the symbol table? Not sure that makes sense to me, let me try
> again. Does ${*$self} mean get the scalar from the symbol table
> referenced by $self? As the scalar is a reference one can follow this to
> the hash and get the value of the key hash_ref.
I would interpret ${*$self}{hash_ref} as:
given %{*$self}, the hash part of the typeglob, return the element
corresponding to key 'hash_ref'
or: %hash = %{*$self}; $element = $hash{hash_ref};
--
Glenn Jackman
NCF Sysadmin
glennj@ncf.ca
------------------------------
Date: Fri, 22 Oct 2004 19:25:33 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Understanding of *$self
Message-Id: <clbmrd$7rq$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>], who wrote in article <claq48$ei3$1@mamenchi.zrz.TU-Berlin.DE>:
> > $ {*$self}{net_telnet_cisco}{last_cmd}
> > (^ the space above is in the module code)
[Never mind, this is probably a workaround for old CPerl Emacs mode]
> > Can someone please explain the use of *$self in creating the object
> > instance and retrieving it's attributes? I'm assuming this is something
> > to do with filehandles and having to use typeglobs?
>
> This is explained in perldata, section "Typeglobs and Filehandles".
Do not think so. At least I could not find it in 5.8.2. Actually, I
could not find it documented anywhere... :
[As it was written later in this thread, one can use globs where a
(symbolic) reference is expected.]
Hope this helps,
Ilya
------------------------------
Date: Fri, 22 Oct 2004 14:05:14 -0400
From: Scott W Gifford <gifford@umich.edu>
Subject: Re: using range gives warning
Message-Id: <qsz7jpi8w85.fsf@gravitar.gpcc.itd.umich.edu>
"Paul Lalli" <mritty@gmail.com> writes:
> "Paul Lalli" <mritty@gmail.com> wrote in message
[...]
>> Perhaps someone can help explain:
>>
>> use strict;
>> use warnings;
>> my @foo;
>> $foo[0] = (6..10);
>> print "Foo: @foo\n";
>> __END__
[...]
>> This small program returns a warning:
>> Use of uninitialized value in range (or flip) at - line 4.
I don't know exactly what's going on, but perhaps the .. is being
treated as a flip-flop operator, which is different from what you
expect.
perlop(1) says:
In scalar context, ".." returns a boolean value. The operator is
bistable, like a flip-flop, and emulates the line-range (comma)
operator of sed, awk, and various editors.
and later:
If either operand of scalar ".." is a constant expression, that
operand is considered true if it is equal ("==") to the current
input line number (the $. variable).
So I suspect that it's checking if $. == 6, but you haven't read any
files, so $. is undef, causing that error.
----ScottG.
------------------------------
Date: 22 Oct 2004 19:08:25 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: using range gives warning
Message-Id: <Xns958A9A040EEDasu1cornelledu@132.236.56.8>
"Paul Lalli" <mritty@gmail.com> wrote in news:HDbed.110$Xq3.65@trndny01:
> Apologies for wasting bandwidth. Really wish I could retract this whole
> thread...
Actually, thank you. I actually learned something and learned it in a way
that (I hope) makes it hard to forget.
Sinan.
------------------------------
Date: Fri, 22 Oct 2004 20:44:21 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: using range gives warning
Message-Id: <Xns958AAA47CE22dkwwashere@216.168.3.30>
Paul Lalli <mritty@gmail.com> wrote:
> "Brian McCauley" <nobull@mail.com> wrote in message
> news:clbghd$hqd$1@sun3.bham.ac.uk...
>> You appear to be confused by the behaviour of the range operator.
>>
>> Have you considered the possibility of reading the explaination
>> of the behaviour of the range operator in the reference manual?
>> (At least as far as the end of the first sentence).
>>
>> Looking up the thing you are confused about in the reference
>> manual should come earlier in you problem solving path than
>> posting to Usenet.
>
> Yup. And in fact, I did read perldoc perlop prior to posting -
> but because of the circumstance in which I found this error, I was
> looking for an explanation regarding something that had to do with
> assigning to an array element. It simply didn't occur to me that
> I was using scalar context.
>
> My apologies again
This simply won't do, Paul. Haven't you learned anything here? You're
supposed to flame Brian for being rude to you and demand that he
parrot the documentation to you rather than reading it for yourself.
Then when others follow up that post, you call them all losers and
either leave in a huff or stick around for days making an ass of
yourself. Top-posting with full-quote is optional, but highly
recommended for the full effect. Or you could have not quoted any
text at all. A simple heartfelt "Fuck you" goes a long way toward
making a lasting impression.
But instead you were polite and agreeable. You even admitted you had
made a mistake, and apologized on top of that! Sheesh! What kind of
usenet poster are you?
------------------------------
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 7288
***************************************