[25039] in Perl-Users-Digest
Perl-Users Digest, Issue: 7289 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 22 21:05:55 2004
Date: Fri, 22 Oct 2004 18:05: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 Fri, 22 Oct 2004 Volume: 10 Number: 7289
Today's topics:
Any good Net::Jabber examples? <njc@wolfgang.uucp>
Re: Guestbook hacked? <matthew.garrish@sympatico.ca>
Re: Guestbook hacked? <noreply@gunnar.cc>
Hard regexp problem (Aaron Sherman)
Re: Hard regexp problem <abigail@abigail.nl>
Re: How to become a perl hacker? (Aaron Sherman)
Re: How to monitor a process in system call <usenet@morrow.me.uk>
Re: How to redefine warnings on recursion level <Jon.Ericson@jpl.nasa.gov>
Re: How to redefine warnings on recursion level <abigail@abigail.nl>
Re: list vs array <usenet@morrow.me.uk>
Re: list vs array <tim@vegeta.ath.cx>
Re: list vs array <doug@yahoo.com>
Re: list vs array <mritty@gmail.com>
Re: list vs array <matthew.garrish@sympatico.ca>
Re: list vs array (Aaron Sherman)
Net::POP3 Install <nospam@nospam.com>
Re: Net::POP3 Install <spamtrap@dot-app.org>
Re: Net::POP3 Install <kalinaubears@iinet.net.au>
Re: Online forum source codes in Perl/CGI without SQL? <usenet@morrow.me.uk>
Re: printing to web browser <jwkenne@attglobal.net>
Re: printing to web browser <Jon.Ericson@jpl.nasa.gov>
Re: Saving attachments from emails (Aaron Sherman)
Re: Understanding of *$self <usenet@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 22 Oct 2004 17:57:08 -0500
From: Neil Cherry <njc@wolfgang.uucp>
Subject: Any good Net::Jabber examples?
Message-Id: <slrncnj424.jvc.njc@wolfgang.uucp>
I'm having quite a bit of trouble with Net::Jabber. I've seen some
examples and I have used them but now I wish to turn on debugging and
can't quite find a good example. Any pointers?
The reason I need the debugging is that a script that was working is
suddenly getting:
Error: Jabber Authorization failed: 406
I suspect that I'm not doing something as opposed to doing something
wrong.
Thanks
--
Linux Home Automation Neil Cherry ncherry@comcast.net
http://home.comcast.net/~ncherry/ (Text only)
http://hcs.sourceforge.net/ (HCS II)
http://linuxha.blogspot.com/ My HA Blog
------------------------------
Date: Fri, 22 Oct 2004 18:26:22 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Guestbook hacked?
Message-Id: <dOfed.59550$JG5.1018412@news20.bellglobal.com>
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:2tsdmsF231d61U1@uni-berlin.de...
> J.Postma wrote:
>
>> I am using the perl script of Matt version 2.3.1
>
> Matt's scripts have a bad reputation because of security holes, but
> personally I don't think the problem has anything to do with that.
>
It's more likely the problem of using popular software written by someone
else, especially open source code. If a spammer knows it has no particular
security, and that many people are using it, it becomes the perfect
opportunity (especially when you know most users aren't smart enough to
change the input ids or alter the code in any way). That's also why it pays
to know at least a little about the language the code is written in. At
least then you can add in your own filters.
Matt
------------------------------
Date: Sat, 23 Oct 2004 01:34:08 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Guestbook hacked?
Message-Id: <2ttk79F22spevU1@uni-berlin.de>
Matt Garrish wrote:
> Gunnar Hjalmarsson wrote:
>> J.Postma wrote:
>>> I am using the perl script of Matt version 2.3.1
>>
>> Matt's scripts have a bad reputation because of security holes, but
>> personally I don't think the problem has anything to do with that.
>
> It's more likely the problem of using popular software written by
> someone else, especially open source code. If a spammer knows it has
> no particular security, and that many people are using it, it becomes
> the perfect opportunity (especially when you know most users aren't
> smart enough to change the input ids or alter the code in any way).
Yeah, that may be true. But isn't the main issue that guestbooks, just
like any open forum, are designed to let anybody post. It's beyond the
scope of the concept to beforehand prevent spammers from posting.
> That's also why it pays to know at least a little about the language
> the code is written in. At least then you can add in your own
> filters.
Agreed.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 22 Oct 2004 16:55:08 -0700
From: AaronJSherman@gmail.com (Aaron Sherman)
Subject: Hard regexp problem
Message-Id: <a2d0070.0410221555.37ea14c8@posting.google.com>
I was stumped for a while today, when I ran into a regular expression
problem. Now, I'm a pretty good regexp hacker, but this problem was so
constrained and seemed at first glance to be so wrong for a regexp
that I didn't think it could be done. However, in specifying it to a
friend, I realized that it could.
I'm curious to see if there's a better solution.
The problem is this: You have a function call in a library that takes
a regexp, anchors it on both ends by adding "^" and "$" to the
beginning end, and then applies that to an input string.
sub foo {
my $re = shift;
my $in = <STDIN>;
die "'$in' is bad" unless $in =~ /^$re$/;
}
It exits with an error if the string does not match the regexp. I
wanted to accept strings that did NOT contain a particular substring.
Normally, I would have written:
!/xyz/
But a) my regexp is going to have to match the whole line, which the
above does not, and b) I can't tell the function to negate the regexp.
In the end, this is what I came up with:
qr{((?=[^x]|x[^y]|xy[^z]).)*}
That was the final version. I had done this previously:
qr{([^x]|x[^y]|xy[^z])*}
but that fails on:
xyxyz
which it allows to slip through because it consumes the leading "xyx"
on the first pass.
------------------------------
Date: 23 Oct 2004 00:09:17 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Hard regexp problem
Message-Id: <slrncnj89d.3ac.abigail@alexandra.abigail.nl>
Aaron Sherman (AaronJSherman@gmail.com) wrote on MMMMLXX September
MCMXCIII in <URL:news:a2d0070.0410221555.37ea14c8@posting.google.com>:
() I was stumped for a while today, when I ran into a regular expression
() problem. Now, I'm a pretty good regexp hacker, but this problem was so
() constrained and seemed at first glance to be so wrong for a regexp
() that I didn't think it could be done. However, in specifying it to a
() friend, I realized that it could.
()
() I'm curious to see if there's a better solution.
()
() The problem is this: You have a function call in a library that takes
() a regexp, anchors it on both ends by adding "^" and "$" to the
() beginning end, and then applies that to an input string.
()
() sub foo {
() my $re = shift;
() my $in = <STDIN>;
() die "'$in' is bad" unless $in =~ /^$re$/;
() }
()
() It exits with an error if the string does not match the regexp. I
() wanted to accept strings that did NOT contain a particular substring.
() Normally, I would have written:
()
() !/xyz/
/^[^x]*(?:x(?!yx)[^x]*)*$/
Or:
/^(?:(?!xyz).)*$/
Abigail
--
perl -Mstrict='}); print "Just another Perl Hacker"; ({' -le1
------------------------------
Date: 22 Oct 2004 17:02:31 -0700
From: AaronJSherman@gmail.com (Aaron Sherman)
Subject: Re: How to become a perl hacker?
Message-Id: <a2d0070.0410221602.69a0fe41@posting.google.com>
Uri Guttman <uguttman@athenahealth.com> wrote in message news:<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, you're a cold, cruel man ;-)
There are two ways to take the grandparent: as a question phrased as
Perl poetry or as Perl poetry phrased as a question.
I prefer to think of it as the former, and if I'm right I'd say you're
already there.
There are three things that identify a good Perl hacker, two of which
have nothing to do with Perl:
1. Skill as a programmer
2. Knowledge of programming techniques
3. Knowledge of Perl
If you lack the first, I'm afraid you're probably SOL.
If you lack the second, it's relatively easy through long and tedious
to pick up.
If you've already covered 1 and 2, 3 is easy and the fact that Perl
ships with documentation that gives most encyclopaedias an inferiority
complex, you don't even have to wonder where to go for the research
you're going to need.
Start with anything in $PERL5LIB/pod/*{help,tut,func,syn}.pod and go
from there.
Good luck.
------------------------------
Date: Fri, 22 Oct 2004 21:56:08 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to monitor a process in system call
Message-Id: <8o8o42-b95.ln1@osiris.mauzo.dyndns.org>
Quoth "Jürgen Exner" <jurgenex@hotmail.com>:
> Howard wrote:
> >
> > When I submit the task using system (vcs ...), sometime simulation
> > could not finish and stops at cli> and give back the control to unix.
> > It waits for user input at this point. Normally people types in quit
> > to let it exit from vcs and keep the regression going.
> >
> > However, I don't how to do this in Perl to know it sits on cli> and
> > type in quit and let it keep going.
>
> I think you are looking for the Expect module.
Alternatively, and more simply, I would be surprised if your 'vcs'
program doesn't have a batch mode switch that causes it to abort on
error rather than prompting; or you could try redirecting stdin (for the
vcs process) from /dev/null, as it may switch to batch mode if it's not
on a terminal.
Ben
--
You poor take courage, you rich take care:
The Earth was made a common treasury for everyone to share
All things in common, all people one.
'We come in peace'---the order came to cut them down. [ben@morrow.me.uk]
------------------------------
Date: Fri, 22 Oct 2004 15:49:38 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: How to redefine warnings on recursion level
Message-Id: <rcgzn2exta5.fsf@Jon-Ericson.sdsio.prv>
Abigail <abigail@abigail.nl> writes:
> Jon Ericson (Jon.Ericson@jpl.nasa.gov) wrote on MMMMLXIX September
> MCMXCIII in <URL:news:rcg3c071viw.fsf@Jon-Ericson.sdsio.prv>:
> -: 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;
$ perl -e '$s = 100*98;$s*=$_ for 2..98;print "$s\n"'
9.23835263990558e+157
The correct answer is:
$ perl -e '$a=$s=1;$a*=$_ for 2..98;$s=$a*99*100-$a;print "$s\n"'
9.33167885534952e+157
But what's a few, umm, 10**155 between friends? ;-)
In either case, the more realist example would be x! - y! repeated
many times for arbitrary values of x and y.
Jon
------------------------------
Date: 22 Oct 2004 23:36:36 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How to redefine warnings on recursion level
Message-Id: <slrncnj6bv.3ac.abigail@alexandra.abigail.nl>
Jon Ericson (Jon.Ericson@jpl.nasa.gov) wrote on MMMMLXX September
MCMXCIII in <URL:news:rcgzn2exta5.fsf@Jon-Ericson.sdsio.prv>:
== Abigail <abigail@abigail.nl> writes:
==
== > Jon Ericson (Jon.Ericson@jpl.nasa.gov) wrote on MMMMLXIX September
== > MCMXCIII in <URL:news:rcg3c071viw.fsf@Jon-Ericson.sdsio.prv>:
==
== > -: 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;
==
== $ perl -e '$s = 100*98;$s*=$_ for 2..98;print "$s\n"'
== 9.23835263990558e+157
==
== The correct answer is:
==
== $ perl -e '$a=$s=1;$a*=$_ for 2..98;$s=$a*99*100-$a;print "$s\n"'
== 9.33167885534952e+157
==
== But what's a few, umm, 10**155 between friends? ;-)
Yeah, I wasn't thinking.
my $sum = 100 * 99 - 1;
$sum *= $_ for 2 .. 98;
==
== In either case, the more realist example would be x! - y! repeated
== many times for arbitrary values of x and y.
x! - y! == (x * (x - 1) * (x - 2) ... * (y + 1) - 1) * y!
sub facdiff {
local $" = "*";
eval "(@{[($_ [1] + 1) .. $_ [0]]} - 1) * @{[1 .. $_ [1]]}";
}
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54\n" and s/<<EOT/<<EOT/ee and print;
"Just another Perl Hacker"
EOT
------------------------------
Date: Fri, 22 Oct 2004 22:01:42 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: list vs array
Message-Id: <m29o42-b95.ln1@osiris.mauzo.dyndns.org>
Quoth "daniel kaplan" <nospam@nospam.com>:
> > 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?
I really shouldn't fall for it...
NO! CPAN is to Perl as metalab.unc.edu is to linux (or something). CPAN
is a collection bits of software *written* in Perl.
Perhaps, CPAN is a subset of 'all programs ever written in Perl'.
An awful lot of it is 'library' software, that you can install and use
from within your own Perl programs; however, it is no more part of Perl
the language or perl the interpreter than Gtk is part of C or gcc.
Ben
--
I've seen things you people wouldn't believe: attack ships on fire off
the shoulder of Orion; I watched C-beams glitter in the dark near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. ben@morrow.me.uk
------------------------------
Date: Fri, 22 Oct 2004 22:13:44 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: list vs array
Message-Id: <slrncnj1d3.gb9.tim@vegeta.saiyix>
An ARRAYREF will probably work better here:
- push @daniel_book_collection, ('learning perl','programming perl','perl
- cookbook', @other_good_perl_books);
+ push @daniel_book_collection, ['learning perl','programming perl','perl
+ cookbook', @other_good_perl_books];
Thought I'd probably use a hash indexed by ISBN, rather than an array of
lc($title), especially as his list of Perl (and programming in general)
books grows.
$library{daniel}{'0201419750'} = {
title => "Effective Perl Programming",
pub => "Addison-Wesley",
...
};
Cheers,
Tim Hammerquist
------------------------------
Date: Fri, 22 Oct 2004 18:12:39 -0400
From: doug <doug@yahoo.com>
Subject: Re: list vs array
Message-Id: <10nj1lcqgabjr63@news.supernews.com>
Randal L. Schwartz wrote:
>>>>>> "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)
>
I loved both books. Did you co-author "Programming Perl"? "Perl in a
Nutshell" 1st ed. page 8 lists you as an author along with Larry Wall.
--
doug
------------------------------
Date: Fri, 22 Oct 2004 18:29:27 -0400
From: Paul Lalli <mritty@gmail.com>
To: spam@doc99.com
Subject: Re: list vs array
Message-Id: <417989C7.4090103@gmail.com>
doug wrote:
> Randal L. Schwartz wrote:
>
>
>>Not "learning perl objects references and modules" (aka "Learning Perl
>>volume 2")?
>>
>
> I loved both books. Did you co-author "Programming Perl"? "Perl in a
> Nutshell" 1st ed. page 8 lists you as an author along with Larry Wall.
Programming Perl 2nd Edition lists as authors:
Larry Wall, Tom Christiansen & Randal L. Schwartz
Programming Perl 3rd Edition lists as authors:
Larry Wall, Tom Christiansen & Jon Orwant
Paul Lalli
------------------------------
Date: Fri, 22 Oct 2004 18:34:12 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: list vs array
Message-Id: <yVfed.59623$JG5.1019240@news20.bellglobal.com>
"Paul Lalli" <mritty@gmail.com> wrote in message
news:417989C7.4090103@gmail.com...
> doug wrote:
>> Randal L. Schwartz wrote:
>>
>>
>>>Not "learning perl objects references and modules" (aka "Learning Perl
>>>volume 2")?
>>>
>>
>> I loved both books. Did you co-author "Programming Perl"? "Perl in a
>> Nutshell" 1st ed. page 8 lists you as an author along with Larry Wall.
>
> Programming Perl 2nd Edition lists as authors:
> Larry Wall, Tom Christiansen & Randal L. Schwartz
>
> Programming Perl 3rd Edition lists as authors:
> Larry Wall, Tom Christiansen & Jon Orwant
>
Yeah, what has that Schwartz guy done for us lately... ; )
Matt
------------------------------
Date: 22 Oct 2004 17:15:09 -0700
From: AaronJSherman@gmail.com (Aaron Sherman)
Subject: Re: list vs array
Message-Id: <a2d0070.0410221615.397a84f8@posting.google.com>
"daniel kaplan" <nospam@nospam.com> wrote in message news:<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.
First off, I want to appologize for the rough treatment you've been
given. I find it stunning that after all these years, people still
waste time on being rude on Usenet.
Second, there are many resources, and I'd start with the ones listed
in the FAQ, but if you have access to any machine at all that you can
install Perl on, I'd do that. If your machine ran slower after
installing Perl, I'm wondering if you're close to being out of disk
space. ActiveState's Perl install itself should not cause you any kind
of grief unless you use it for something.
Ok, so in answer to your original question: an array is a kind of
variable in Perl. A list is a more conceptual thing created on-the-fly
when you do something like list items in parens, separated by commmas:
(1,2,3,4)
or pass "lists" of values around:
@foo = sort @bar.
@foo and @bar are arrays, but what you're passing to sort and what
gets returned from sort are lists of values, unassociated with any
particular array until you store them into @foo.
As for what CPAN is... it's a huge repository of modules and other
source code related to Perl and replicated among dozens of machines
around the world. CPAN is effectively Perl's extended "library" of
extensions and examples ranging from trivial, single-purpose tools and
modules to behemoths like PDL (a math and scientific package).
Good luck!
------------------------------
Date: Fri, 22 Oct 2004 19:37:03 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Net::POP3 Install
Message-Id: <1098488248.537389@nntp.acecape.com>
ok, here we go again....
(realizing i had to have Perl on my machine so I could debug) i downloaded
ActiveState Perl 5.6 and from perldoc.com i do see Net::POP3 under 5.6 dox.
but everytime i type Install Net::POP3, it always says could not locate PPD.
i eventually did an install on DBI, knowing it came with Perl...and it said,
already installed....just wanted to check that i was cool on the syntax...
did some searching looking for Net::POP3 repositories, but can't seem to get
the hang....
anyone familiar with ActiveState Perl and repositories? truth is I need
more than one module installed....
thanks ahead
------------------------------
Date: Fri, 22 Oct 2004 20:29:27 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Net::POP3 Install
Message-Id: <0vidnfzUYLx1OOTcRVn-ig@adelphia.com>
daniel kaplan wrote:
> (realizing i had to have Perl on my machine so I could debug) i downloaded
> ActiveState Perl 5.6
Why such an old version?
> and from perldoc.com i do see Net::POP3 under 5.6 dox.
We must be looking at different internets. The perldoc.com on *my*
internet has a search box on the front page, and entering "Net::POP3"
into that box gives me the following link:
<http://www.perldoc.com/perl5.6.1/lib/Net/POP3.html>
ActiveState's installer should also have installed the Perl docs on your
start menu - although I'm not certain precisely where. It's been a long
time since I've been forced to use Windows.
Another option is to open up a terminal prompt (or DOS box, command
prompt, or whatever Bill tells you to call it today) and enter 'perldoc
Net::POP3'.
> but everytime i type Install Net::POP3, it always says could not locate PPD.
Of course. Net::POP3 is a core module, so there's no separate PPD to
install it from.
I can hear the pending complaint already... "but how was I supposed to
know it's a core module?" The answer to that is - you're not expected to
know that. You're expected to be able to look it up, in "perldoc
perlmodlib" or <http://www.perldoc.com/perl5.6.1/lib.html>.
Note that the perldoc command always returns the documentation that's
appropriate for the version of Perl you have on your system, whereas the
link to perldoc.com is specific to Perl 5.6.1, and should be altered
accordingly for different Perl versions.
> did some searching looking for Net::POP3 repositories
What is *that* supposed to mean? This ain't C - you don't have to go
searching high and low for libraries. If you want PPDs for ActiveState's
Perl distribution, you get them from ActiveState, and you go to
activestate.com to see what packages they make available that way.
If you want source tarballs that work with generic Perl, go to cpan.org.
> anyone familiar with ActiveState Perl and repositories?
ActiveState has extensive documentation regarding the specifics of their
distribution on their site.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sat, 23 Oct 2004 10:21:51 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Net::POP3 Install
Message-Id: <4179a565$0$23009$5a62ac22@per-qv1-newsreader-01.iinet.net.au>
daniel kaplan wrote:
> ok, here we go again....
>
> (realizing i had to have Perl on my machine so I could debug) i downloaded
> ActiveState Perl 5.6 and from perldoc.com i do see Net::POP3 under 5.6 dox.
>
> but everytime i type Install Net::POP3, it always says could not locate PPD.
> i eventually did an install on DBI, knowing it came with Perl...and it said,
> already installed....just wanted to check that i was cool on the syntax...
>
> did some searching looking for Net::POP3 repositories, but can't seem to get
> the hang....
>
> anyone familiar with ActiveState Perl and repositories? truth is I need
> more than one module installed....
>
What build of AS perl ? Both my build 638 and 810 already have Net::POP3
and I *think* they were there already (which would be why AS don't
provide a ppm package for that module).
Otherwise run 'ppm set' to check that the AS repository is one of the
locations being searched.
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
Date: Fri, 22 Oct 2004 21:53:11 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Online forum source codes in Perl/CGI without SQL?
Message-Id: <ni8o42-b95.ln1@osiris.mauzo.dyndns.org>
Quoth "Kelvin" <thefatcat28@hotmail.com>:
> Is there any forum source code (open source) that doesn't use SQL database?
> My website package doesn't give me SQL service :(
This Is Not A Perl Question, but...
You can get SQL without a database using DBD::SQLLite. This won't
provide concurrency or consistency checking, though, which is why most
forum packages use a database.
Ben
--
I must not fear. Fear is the mind-killer. I will face my fear and
I will let it pass through me. When the fear is gone there will be
nothing. Only I will remain.
ben@morrow.me.uk Frank Herbert, 'Dune'
------------------------------
Date: Fri, 22 Oct 2004 22:08:35 GMT
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: printing to web browser
Message-Id: <Dxfed.48749$YM4.16550317@news4.srv.hcvlny.cv.net>
Ben Morrow wrote:
> Just 'cos the docs contradict themselves doesn't make them wrong :)
...as Gödel's Theorem vanishes up its own nose....
--
John W. Kennedy
"Sweet, was Christ crucified to create this chat?"
-- Charles Williams. "Judgement at Chelmsford"
------------------------------
Date: Fri, 22 Oct 2004 16:02:16 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: printing to web browser
Message-Id: <rcgzn2exsp3.fsf@Jon-Ericson.sdsio.prv>
krakle@visto.com (krakle) writes:
> Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in message news:<211020041524059555%jgibson@mail.arc.nasa.gov>...
>> In article <1098395030.248283@nntp.acecape.com>, daniel kaplan
>> <nospam@nospam.com> wrote:
>>
>> > still new to PERL, anyway write now i do all OUTPUTTING to the
>> > web browser with:
>>
>> Experienced Perl programmers don't use all CAPS.
>
> Then why did you use CAPS?
Sigh. Because it's shorter than Capitalization Annoying to Perl
Scripters.
Jon
P.S. I sense a "script versus program" flamewar coming on.
------------------------------
Date: 22 Oct 2004 17:16:19 -0700
From: AaronJSherman@gmail.com (Aaron Sherman)
Subject: Re: Saving attachments from emails
Message-Id: <a2d0070.0410221616.3220ef76@posting.google.com>
nottm@hotmail.com (Jules Mitland) wrote in message 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?
Actally, you should use MIME::Tools, which provides a comprehensive
interface to MIME-encoded documents including email.
------------------------------
Date: Fri, 22 Oct 2004 21:51:15 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Understanding of *$self
Message-Id: <3f8o42-b95.ln1@osiris.mauzo.dyndns.org>
Quoth Jim Mozley <jim.mozley@exponential-e.com>:
> [Anno]
> >
> >[Jim Mozley]
> >>
> >>Using Data::Dumper on my instance variable I get...
> >>
> >>$VAR1 = bless( \*Symbol::GEN0, 'Ee::Net::Device' );
> >>
> >>So I assume that as the error tells me my instance is not a ref to a
> >>hash. That's where my understanding ends at the moment.
>
<snip>
>
> What does the *$self represent (i know it's the object)? Is it a
> reference to a specific symbol table ( Symbol::GENO )?
Nearly. *Symbol::GEN0 is a glob. This means it contains all of
$Symbol::GEN0, %Symbol::GEN0, and, importantly, the IO handle called
Symbol::GEN0 (IO handles cannot be referred to directly[1] as they have
no sigil). This is why the object is a globref: because it is
encapsulating an IO handle.
So, ignoring the bless (which is irrelevant), $self = \*Symbol::GEN0.
[1] for pedants, I don't count *FOO{THING} as 'directly' :)
> Knowing this might help me understand ${*$self}{hash_ref}.
Right... as usual with complicated reference stuff, work inside-out.
First we have $self, which is \*Symbol::GEN0.
Then we deref this (a globref is dereffed with *, as you'd expect), and
get *$self, which is *Symbol::GEN0.
Now comes the confusing bit, which I at least can't find anywhere in the
documentation :). It is sort-of implied by the fact that *foo = \$bar
performs a limited version of *foo = *bar, but anyhow...
A glob (*not* a globref) may be treated as a reference to any of its
components. That is, %{*foo} is equivalent to %foo, and even
our %x;
my $y = *x;
%$y
will correctly refer to %x. Note that this glob value (which is *not* a
reference) can be 'dereffed' with any of %$@, unlike any real reference.
So, since ${...}{...} is a hash-deref operator, ${*$self}{hash_ref}
refers to $Symbol::GEN0{hash_ref}, which is a perfectly ordinary hash
member.
[As a side note, I would have expected from the docs that this would
have to be written
${*{*$self}{HASH}}{hash_ref}
, ie.
$self globref
*$self deref to glob
*{...}{HASH} extract ref to hash portion (see perlref)
${...}{...} deref and locate a key
but it seems (as usual) Perl is at least two levels DWIMer than I
thought :)]
> again. Does ${*$self} mean get the scalar
It's not ${*$self}, it's ${ *$self }{...}; ie. it's a hash deref, not a
scalar deref. This is one of the Very Confusing things about perl refs,
and is why it's generally a good idea to use -> instead [goes to another
vt and experiments... wow,
our %x = (qw/a b/);
my $y = \*x;
print STDOUT (*$y)->{a};
actually does what I thought it would... :) ].
> from the symbol table
Glob, not symbol table. Something like Symbol:: or Net::Telnet:: is a
symbol table; it is in fact a special hash whose values are all globs.
> 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.
No, 'cos it's not a scalar it's a hash, so you don't need to deref. You
just get the key.
Ben
--
We do not stop playing because we grow old;
we grow old because we stop playing.
ben@morrow.me.uk
------------------------------
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 7289
***************************************