[24167] in Perl-Users-Digest
Perl-Users Digest, Issue: 6359 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 4 00:05:46 2004
Date: Sat, 3 Apr 2004 21:05:07 -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 Sat, 3 Apr 2004 Volume: 10 Number: 6359
Today's topics:
Re: best free Perl editor for Windows? <gp@nospm.hr>
Re: Cannot reset LIBPATH in perl program on AIX <shirsch@adelphia.net>
Re: eval() <gnari@simnet.is>
Re: free source for bbs <kkeller-usenet@wombat.san-francisco.ca.us>
Re: free source for bbs <uri@stemsystems.com>
Re: free source for bbs <uri@stemsystems.com>
Re: free source for bbs <ian@WINDOZEdigiserv.net>
Re: free source for bbs (Jay Tilton)
Re: free source for bbs <webmaster@infusedlight.net>
Re: free source for bbs <webmaster@infusedlight.net>
Re: free source for bbs <webmaster@infusedlight.net>
Re: free source for bbs <webmaster@infusedlight.net>
Re: free source for bbs <jtc@shell.dimensional.com>
Re: How do I do when handling the data <gnari@simnet.is>
just curious about perl coders <webmaster@infusedlight.net>
Re: Matching between blank lines (J. Romano)
Re: Matching between blank lines <jtc@shell.dimensional.com>
problem installing HTML-Parser-3.36-1 (Ian D.)
real, simple sample OOP intro text??!! <geoffacox@dontspamblueyonder.co.uk>
Re: real, simple sample OOP intro text??!! <tassilo.parseval@rwth-aachen.de>
Re: real, simple sample OOP intro text??!! <invalid-email@rochester.rr.com>
Re: RFC: UniqueID Module <john@newchester.com>
Re: scope again <invalid-email@rochester.rr.com>
Re: test <webmaster@infusedlight.net>
Re: UniqueID Module <john@newchester.com>
Re: Writing to STDIN <webmaster@infusedlight.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 4 Apr 2004 00:47:23 +0200
From: "PHP2" <gp@nospm.hr>
Subject: Re: best free Perl editor for Windows?
Message-Id: <c4nes4$58g$1@ls219.htnet.hr>
thanks people
"PHP2" <gp@nospm.hr> wrote in message news:c4ks4f$59h$1@ls219.htnet.hr...
> what is best free Perl editor for Windows?
>
>
------------------------------
Date: Sat, 03 Apr 2004 12:17:51 -0500
From: "Steven N. Hirsch" <shirsch@adelphia.net>
Subject: Re: Cannot reset LIBPATH in perl program on AIX
Message-Id: <E-2dncjuZM5dbPPdRVn-tA@adelphia.com>
Darin McBride wrote:
>>>> I am having a problem with my perl module on AIX system. I cannot
>>>> reset LIBPATH variable from my perl module.
>>>
>>> You can set it. What you mean is that setting it doesn't have any
>>>effect. This is true. The value used is that at program startup.
>>
>> This is true.
>
>
> You might be lucky enough to be able to put your env changes in a BEGIN
> block and have that work. If not, you may need to resort to some
> serious amounts of trickery.
Actually, AIX is probably the only environment where you _can_ affect
the dynamic library search path at runtime (Darin, you should know that
<g>).
Just make sure that you condition $ENV{LIBPATH} such that it's executed
prior to perl 'use'ing the DBI extension. A BEGIN block which preceeds
the use statement lexically will do the trick.
Be aware that no flavor of *ix (which I'm aware of) other than AIX has a
system loader which responds to changes after initial program load.
Not sure if this is a bug or a feature.
Steve
------------------------------
Date: Sat, 3 Apr 2004 17:02:18 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: eval()
Message-Id: <c4mqkc$o3g$1@news.simnet.is>
"toylet" <toylet_at_mail.hongkong.com> wrote in message
news:406e3211$1_1@rain.i-cable.com...
> > You want eval{} not eval(). They do quite different things. BTW: For
> > what you are doing you don't need to know what eval() does but if
>
> Program execution now continued, but the error message still showed up.
> COuld I suppress that as well?
>
> DBD::mysqlPP::db do failed: Unknown table 'foo' at ./mysql.pl line 14.
>
DBI docs
gnari
------------------------------
Date: Sat, 3 Apr 2004 08:48:12 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: free source for bbs
Message-Id: <cspm4c.vus.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In article <c4ls30$3m0$1@nets3.rz.RWTH-Aachen.DE>, Tassilo v. Parseval wrote:
> Hmmh, have you really? Appears as though someone is flooding your board
> with an automated script or something. I guess he's having fun...
I wonder if Robin is a honeypot? Not just in the sense of
attracting crackers to her site, but in attracting onlookers
in clpmisc....
- --keith :)
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)
iD8DBQFAburJhVcNCxZ5ID8RAqx0AKCEanwEDwMWDP4AJ9dHbIGfla4MzQCfTh6A
8+dd3Ba1b6NkutBzE1gO0Ag=
=Zfxg
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 03 Apr 2004 17:01:10 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: free source for bbs
Message-Id: <x7llldhu7h.fsf@mail.sysarch.com>
>>>>> "KK" == Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
KK> I wonder if Robin is a honeypot? Not just in the sense of
KK> attracting crackers to her site, but in attracting onlookers
KK> in clpmisc....
s/honey/crack/ ;
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sat, 03 Apr 2004 17:01:56 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: free source for bbs
Message-Id: <x7n05thu83.fsf@mail.sysarch.com>
>>>>> "KK" == Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
KK> I wonder if Robin is a honeypot? Not just in the sense of
KK> attracting crackers to her site, but in attracting onlookers
KK> in clpmisc....
s/honey/crack/ ;
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sat, 03 Apr 2004 17:18:43 GMT
From: "Ian.H" <ian@WINDOZEdigiserv.net>
Subject: Re: free source for bbs
Message-Id: <pan.2004.04.03.17.19.46.313000@bubbleboy.digiserv.net>
On Sat, 03 Apr 2004 17:01:10 +0000, Uri Guttman wrote:
>>>>>> "KK" == Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
>
> KK> I wonder if Robin is a honeypot? Not just in the sense of
> KK> attracting crackers to her site, but in attracting onlookers
> KK> in clpmisc....
>
> s/honey/crack/ ;
>
> uri
He's not the only one.. I had this reply to a post I made earlier:
[quote]
What's PoS and what's wrong with Matt's formmail? It can be set up to
prevent spam, with careful use of the referers and recipients.
[/quote]
I almost had to stich my sides back up =)
The problem with these types of people (not understanding) is they don't
realise the rest of the problems they bring to other users on the 'net.
Whether that BBS could be exploited like formmail I don't know.. the
layout alone of the BBS told me to not even bother downloading it (was way
too under developed).. but it seems so many are all too happy to put such
insecure code online and think they're the bees knees without considering
the consequences =\
Regards,
Ian
--
Ian.H
digiServ Network
London, UK
http://digiserv.net/
------------------------------
Date: Sat, 03 Apr 2004 21:47:34 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: free source for bbs
Message-Id: <406f242f.51421987@news.erols.com>
"Ian.H" <ian@WINDOZEdigiserv.net> wrote:
: The problem with these types of people (not understanding) is they don't
: realise the rest of the problems they bring to other users on the 'net.
: Whether that BBS could be exploited like formmail I don't know..
Formmail is a regular Fort Knox of security compared to Robin's opus.
Dig this tidbit from admin.pl :
sub checkuser
{
if ($FORM{'showuser'})
{
@userns = &getusersfromfiles;
if ($FORM{'users'})
{
@usrsplit = split (/\./, $FORM{'users'});
foreach $usern (@userns)
{
open (USR, "$FORM{'users'}") or die $!;
...
So there's a two-argument form of open() using completely unlaundered
user-supplied data for the filename. Why not just set the computer on fire
now and avoid the rush?
Seriously, Robin. Your program is a ticking time bomb. Leaving it up and
running is lunacy.
------------------------------
Date: Sat, 3 Apr 2004 18:54:39 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: free source for bbs
Message-Id: <c4nv4f$ng1$2@reader2.nmix.net>
"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:cspm4c.vus.ln@goaway.wombat.san-francisco.ca.us...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> In article <c4ls30$3m0$1@nets3.rz.RWTH-Aachen.DE>, Tassilo v. Parseval
wrote:
>
> > Hmmh, have you really? Appears as though someone is flooding your board
> > with an automated script or something. I guess he's having fun...
>
> I wonder if Robin is a honeypot? Not just in the sense of
> attracting crackers to her site, but in attracting onlookers
> in clpmisc....
I must be doing both.... it's not a girl. Later,
-Robin
> - --keith :)
>
> - --
> kkeller-usenet@wombat.san-francisco.ca.us
> (try just my userid to email me)
> AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
>
> -----BEGIN xxx SIGNATURE-----
> Version: GnuPG v1.2.2 (Darwin)
>
> iD8DBQFAburJhVcNCxZ5ID8RAqx0AKCEanwEDwMWDP4AJ9dHbIGfla4MzQCfTh6A
> 8+dd3Ba1b6NkutBzE1gO0Ag=
> =Zfxg
> -----END PGP SIGNATURE-----
------------------------------
Date: Sat, 3 Apr 2004 18:51:46 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: free source for bbs
Message-Id: <c4nv4e$ng1$1@reader2.nmix.net>
7
"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:cbmk4c.qhp.ln@goaway.wombat.san-francisco.ca.us...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2004-04-02, Robin <webmaster@infusedlight.net> wrote:
> >
> > I've actually fixed the security glitches now....it's really shitty to
get
> > hacked, but it won't happen again.
>
> You took down the script?
it's back and the password file is not world readable...
> - --keith
>
> - --
> kkeller-usenet@wombat.san-francisco.ca.us
> (try just my userid to email me)
> AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
>
> -----BEGIN xxx SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
>
> iD8DBQFAbdyrhVcNCxZ5ID8RAjVDAJ9/oInSKmvzdSxX5xDRx+vxUbgdRwCfZzNa
> V7LS32laroh5Jz9WJxM1bZA=
> =KzH9
> -----END PGP SIGNATURE-----
------------------------------
Date: Sat, 3 Apr 2004 19:04:24 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: free source for bbs
Message-Id: <c4nv4g$ng1$3@reader2.nmix.net>
Well, it hasn't been hacked again in about half a day, I know how they did
it the first time, fixed that, and I know how they did it the second time
because my password for the admin script was something easily guessable, but
the last time must have been done with some sort of exploiter script that
submitted a lot of stuff through my forms through http. Can someone tell me
a few lines of code I could use in the script - www.infusedlight.net/bbs/
(download here) that would prevent it from being insecure, I know this is
asking a lot, but I'd like to be able to be running a good, safe, secure
message board system. In any event, I have a feeling that it might be really
exploited soon now that I have a feature to mail posts to you, hopefully
that doesn't happen. I also have a feeling that to get a secure script
written I'll have to start over from scratch.
Password files are no longer world readable.
BTW, I'm a he-novice not a she- if you'd like to see some of the stuff I do
as my main field of practice, writing, go to
http://www.infusedlight.net/robin/stories.shtml - I know you're gonna say I
should abandon programming, but why? There's no good reason for abandoning
something once you've started and already have a backbone of knowledge for
it.
Regards,
-Robin
------------------------------
Date: Sat, 3 Apr 2004 19:49:28 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: free source for bbs
Message-Id: <c4o1ou$pe2$1@reader2.nmix.net>
Ok, I'll take ya'll's advice, I took down the whole bbs, it got hacked too
much. Later,
-Robin
------------------------------
Date: 3 Apr 2004 21:19:04 -0700
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: free source for bbs
Message-Id: <slrnc6v35o.d9p.jtc@shell.dimensional.com>
In article <c4nv4g$ng1$3@reader2.nmix.net>, Robin wrote:
> Well, it hasn't been hacked again in about half a day, I know how they did
> it the first time, fixed that, and I know how they did it the second time
> because my password for the admin script was something easily guessable, but
> the last time must have been done with some sort of exploiter script that
> submitted a lot of stuff through my forms through http. Can someone tell me
> a few lines of code I could use in the script - www.infusedlight.net/bbs/
> (download here) that would prevent it from being insecure, I know this is
> asking a lot, but I'd like to be able to be running a good, safe, secure
> message board system. In any event, I have a feeling that it might be really
> exploited soon now that I have a feature to mail posts to you, hopefully
> that doesn't happen. I also have a feeling that to get a secure script
> written I'll have to start over from scratch.
>
> Password files are no longer world readable.
>
> BTW, I'm a he-novice not a she- if you'd like to see some of the stuff I do
> as my main field of practice, writing, go to
> http://www.infusedlight.net/robin/stories.shtml - I know you're gonna say I
> should abandon programming, but why? There's no good reason for abandoning
> something once you've started and already have a backbone of knowledge for
> it.
If you enjoy it, then by all means, keep doing it, and keep learning how to
do it better.
--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
------------------------------
Date: Sat, 3 Apr 2004 16:59:07 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: How do I do when handling the data
Message-Id: <c4mqed$o3f$1@news.simnet.is>
"CatcherInTheRye" <letnomanenterhere@yahoo.co.kr> wrote in message
news:c4jfu3$qf8@netnews.proxy.lucent.com...
> Hi, How are you.
>
> I am a complete perl beginner.
> So, now I don't know how to handle efficiently the raw data to any data
> structure.
>
>
> 89 ;1;148;|89 ;2;316;|89 ;3;484;|45 ;1;142;|
[snip]
>
> "89 ;1;148" of first line is KEY and means CELL;SECTOR;PN
> and has its neighbor list like "89 ;2;316;|89 ;3;484;|45 ;1;142;|"
>
> Other line has same meaning.
>
> I hope to code the script to process following conditions.
>
> 1. Don't have same PN in the same line. If there is , print "Same PN
in
> the '46 ;1;76 ' "
> 89 ;1;148;|89 ;2;316;|89 ;3;484;|45 ;1;142;|
> * * * *
if would use split() to split the lines into records
i would use a hash of Arrays to map each neighbour to the keys
I would use a split again or m// to extract the PNs of each line
and use a temporary hash to detect duplicates
> 2. Second field "89 ;2;316;" should be existed in the line where "89
> ;2;316;" is key.
> if there is not, print "89 ;1;148;" has "89 ;2;316;" but "89
;2;316"
> don't have "89 ;1;148;".
> 89 ;1;148;|89 ;2;316;|89 ;3;484;|45 ;1;142;|
> +++++++++ *********
> 89 ;2;316;|89 ;1;149;|89 ;3;484;|101;1;120;|
> ********* +++++++++
>
after all lines have been processes, I would loop over the keys
of the neighbour-hash to make sure all backreferences are there.
gnari
------------------------------
Date: Sat, 3 Apr 2004 19:10:27 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: just curious about perl coders
Message-Id: <c4nvfm$nkj$1@reader2.nmix.net>
I had one question, does anyone here work on developing perl, the language?
I'd like to talk to some of the team.
--
Regards,
-Robin
--
webmaster@infusedlight.net
------------------------------
Date: 3 Apr 2004 20:02:25 -0800
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Matching between blank lines
Message-Id: <b893f5d4.0404032002.548390e2@posting.google.com>
"gibbering poster" <noone@nowhere.com> wrote in message news:<k4K7c.13441$K85.6190@newssvr27.news.prodigy.com>...
>
> My question is: How do I take a multi-line string, and match the data
> between blank lines?
>
> Take the following:
>
> __BEGIN-STRING__
> blahblahblahblah
> 1234: --dfs-ffjlkj
>
> THIS IS WHAT I WANT TO MATCH
>
> JUnkjunkjunk
> 12o3iu
> __END-STRING__
>
> How would I match the text between the 2 blank with a regular
> expression? I.e. 'THIS IS WHAT I WANT TO MATCH' ?
This is a great opportunity to learn about the "..." (triple dot)
operator in Perl. Many people don't know about the triple-dot
operator so it's not used very much. It's used in a loop inside a
conditional statement and it returns true BETWEEN matches.
For example, the following code snippet:
while (<>)
{
if (/MATCH1/ ... /MATCH2/)
{
print $_;
}
}
prints the lines between (and including) the lines that match the
patterns /MATCH1/ and /MATCH2/.
So what you want to do is make the pattern matches match blank
lines by using /^\s*$/ as the pattern match. Keep in mind, however,
that since you do not want to print the blank lines themselves, you
will have to check if the lines are not blank before printing them.
To clarify, here is a small example program that will do exactly what
you want:
#!/usr/bin/perl -w
use strict;
# Note: /^\s*$/ is the pattern match that
# matches blank lines
while(<DATA>)
{
if (/^\s*$/ ... /^\s*$/) # matches pairs of blank lines
{ # and everthing in-between
next if /^\s*$/; # don't print the blank lines
print $_;
}
}
__DATA__
blahblahblahblah
1234: --dfs-ffjlkj
THIS IS WHAT I WANT TO MATCH
JUnkjunkjunk
12o3iu
__END__
You can also execute this code as a one-liner with the -n switch,
like this:
perl -ne 'print if /^\s*$/ ... /^\s*$/ and not /^\s*$/'
(Change the single quotes to double quotes if you want it to run on
Win32 machines.)
There is one thing you need to watch out for, however. This code
will print out all the text between the first and second blank lines,
and the third and fourth blank lines, and the fifth and sixth blank
lines, and so on. It will NOT print any lines between the second and
third blank lines (or the fourth and the fifth blank lines, etc.), so
if an extra blank line were inserted anywhere in the input text, it
would throw off the successive matches and print out exactly what you
wouldn't want.
But if you ever need to match blocks of text marked by specific
tags, the triple-dot operator comes in very handy.
I hope this helps,
Jean-Luc Romano
------------------------------
Date: 3 Apr 2004 21:28:09 -0700
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Matching between blank lines
Message-Id: <slrnc6v3mp.d9p.jtc@shell.dimensional.com>
In article <b893f5d4.0404032002.548390e2@posting.google.com>, J. Romano wrote:
> "gibbering poster" <noone@nowhere.com> wrote in message news:<k4K7c.13441$K85.6190@newssvr27.news.prodigy.com>...
>>
>> My question is: How do I take a multi-line string, and match the data
>> between blank lines?
>>
>> Take the following:
>>
>> __BEGIN-STRING__
>> blahblahblahblah
>> 1234: --dfs-ffjlkj
>>
>> THIS IS WHAT I WANT TO MATCH
>>
>> JUnkjunkjunk
>> 12o3iu
>> __END-STRING__
>>
>> How would I match the text between the 2 blank with a regular
>> expression? I.e. 'THIS IS WHAT I WANT TO MATCH' ?
>
> This is a great opportunity to learn about the "..." (triple dot)
> operator in Perl. Many people don't know about the triple-dot
> operator so it's not used very much. It's used in a loop inside a
> conditional statement and it returns true BETWEEN matches.
>
> For example, the following code snippet:
>
> while (<>)
> {
> if (/MATCH1/ ... /MATCH2/)
> {
> print $_;
> }
> }
>
Wow, that's a pretty powerful operator - reminds me of /expr/,/expr/ in vi.
And I wasn't aware of it. Thanks for pointing it out.
--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
------------------------------
Date: 3 Apr 2004 09:56:22 -0800
From: id2001@cablelabs.com (Ian D.)
Subject: problem installing HTML-Parser-3.36-1
Message-Id: <1276a5f0.0404030956.531b4b4@posting.google.com>
I have a solaris 8 system running perl 5.005_02. Whenever I do a make
test, I get the following. I tried debugging it, and sure enough
field #1 of the token structure is undef. Using newer versions of
perl on another machine have 'img' or 'a' for that field. Does anyone
have any ideas? I would rather not upgrade perl at this time if I
don't have to, since I would have to upgrade many servers to maintain
version consistency required by our organization.
t/tokeparser........Use of uninitialized value at
blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 105.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 105.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 105.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 53.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 53.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 126.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 130.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 66.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 67.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 53.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 53.
FAILED tests 4, 7-8, 10-11
Failed 5/11 tests, 54.55% okay
Failed Test Status Wstat Total Fail Failed List of failed
-------------------------------------------------------------------------------
t/tokeparser.t 11 5 45.45% 4, 7-8, 10-11
Thanks,
Ian
------------------------------
Date: Sat, 03 Apr 2004 22:33:58 GMT
From: Geoff Cox <geoffacox@dontspamblueyonder.co.uk>
Subject: real, simple sample OOP intro text??!!
Message-Id: <67eu60daua6ka6oulth7nkc2scjs74fotn@4ax.com>
Hello
I am trying to get started with Perl OOP but all the texts I have seen
so far, both from the Net and Perl bools are, either too abstract or
assume far too much ... I never want to see another OOP explanation
based on mythical cars, flowers, countries or whatever!
I am looking for a simple but real example of code based on a real
class (package) with the methods etc clearly explained.
Is this asking too much?!
Back in 1998, when I was trying to understand ODBC and CGI, I had the
same problem. In the end I was able to write a simple, step by step
approach (http://www.micro-active.com/dbase.htm) which was picked up
by a newsgroup and for several years afterwards I received thanks from
around the world for being in between too abstract and too complex ...
Can someone do the same for me now re Perl and OOP !!!???
Cheers
Geoff
------------------------------
Date: 3 Apr 2004 23:22:37 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: real, simple sample OOP intro text??!!
Message-Id: <c4ngvt$f0k$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Geoff Cox:
> I am trying to get started with Perl OOP but all the texts I have seen
> so far, both from the Net and Perl bools are, either too abstract or
> assume far too much ... I never want to see another OOP explanation
> based on mythical cars, flowers, countries or whatever!
It appears to be rather popular among OOP-tutorial-writers to use these
kind of examples. I also sometimes wish they used simple real-world
scenarios. Or rather, I wished they had used them years ago when I
learnt it.
> I am looking for a simple but real example of code based on a real
> class (package) with the methods etc clearly explained.
>
> Is this asking too much?!
From your rant above, I conclude that you have probably already read
perlboot.pod. If not, then you'll hate it because it involves animals.
A little more demanding is perltoot.pod. It has the advantage that it
uses less colorful examples (and ones more likely to occur in the
context of computers and programming).
> Can someone do the same for me now re Perl and OOP !!!???
Do you consider yourself totally clueless as for OOP or have you already
picked up a few things from the tutorials that you've read rather
joylessly? Perhaps you have already reached stage 2 which means you know
little but you know enough to ask questions relating to OOP in this
group. People here will help you with them.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Sun, 04 Apr 2004 03:58:16 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: real, simple sample OOP intro text??!!
Message-Id: <406F877B.4030309@rochester.rr.com>
Geoff Cox wrote:
...
> I am trying to get started with Perl OOP but all the texts I have seen
> so far, both from the Net and Perl bools are, either too abstract or
> assume far too much ... I never want to see another OOP explanation
> based on mythical cars, flowers, countries or whatever!
>
> I am looking for a simple but real example of code based on a real
> class (package) with the methods etc clearly explained.
...
Have you tried "Object Oriented Perl" by Damian Conway, Manning
Publications? I thought it was crystal clear and generally excellent.
My apoligies if it is one of the offending books -- different things for
different folks.
> Geoff
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sat, 3 Apr 2004 10:07:05 -0600
From: "John" <john@newchester.com>
Subject: Re: RFC: UniqueID Module
Message-Id: <c4mnfk$a72$1@news.f.de.plusline.net>
One more point in the case for UniqueID that I didn't mention: a UniqueID
would maintain it's identity through serialization across processes. It
would be implemented as a blessed reference to a scalar containing the
symbol name.
Also, below is another perhaps beter example of UniqueID's use, although it
is still contrived:
use UniqueID 'error';
sub bar {
my($arg) = @_;
return not(1) ? $arg : error;
}
my $foo = bar('baz');
print $foo eq error ? "Foo is no good." : "Foo is $foo.";
The actual situation where I want to use UniqueID is too complicated for
this post, but I need a variable to be able to contain *any* value that the
user can throw at it, *or* some flag value that is above all the other
values
Also, are you sure that == and != wouldn't bet appropriate comparators,
since UniqueID objects aren't strings any more than they are numbers, and
the == operators implies "mathematical identity", which is really what I'm
aiming for. So you'd have
use UniqueID 'infinity';
my $variable = 5;
print "5 is infinite!\n" if $variable == infinity;
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:c4llrr$41q$1@mamenchi.zrz.TU-Berlin.DE...
> John <john@newchester.com> wrote in comp.lang.perl.misc:
> > I need an alternative for 'use constant', but that allows the definition
of
> > unique IDs not associated with scalar values.
> >
> > I propose the UniqueID class, summarized below. I'm asking this list:
> >
> > - Is this module necessary, or is there a better way to do this?
> > - Is it aptly named?
> > - Other comments before I post to CPAN?
> >
> >
> > Synopsis:
> >
> > use UniqueID qw (red yellow blue);
> >
> > my $color = red;
> >
> > print "Just as we thought!\n" if $color == red;
> > print "This will never happen!\n" if $color == blue;
> > print "Nor will this!\n" if $color == 'red';
> ^^
> Wrong comparison operator. "==" is for numbers, you need "eq".
>
> > print "Color is ".$color->name.".\n";
> >
> > $color + 1; #Raises an exception. Addition isn't defined for UniqueID
> > objects.
> >
> > Output:
> > Just as we thought!
> > Color is red.
> > The '+' operation isn't defined for UniqueID objects at C:\test5.pl line
11
>
> You can have unique identifiers in Perl by just taking a reference to
> anything. So you get most of the behavior you describe after just saying:
>
> use constant red => \ '';
> use constant yellow => \ '';
> use constant blue => \ '';
>
> instead of
>
> use UniqueID qw (red yellow blue);
>
> The difference is that the arithmetic operation is allowed and that
> there is no ->name method.
>
> > Rationale:
> >
> > UniqueID lets you define unique identifiers that are not associated with
> > scalar values. Contrast this with the "constant" package, which simply
> > aliases names to scalar values.
> >
> > UIDs are safer than constants, because they can not accidently be
confused
> > with un-related scalars. For example, the following accident might
happen
> > using aliased constants:
> >
> > use constant red => 0;
> >
> > my $color;
> > my $color = red if not 1; #*Don't* set $color to red.
> >
> > #Comparing $color to red is the same as comparing it to 0.
> > if($color == red) {
> > print "Color is red!\n";
> > } else {
> > print "Color is NOT red!\n";
> > }
> >
> > Output: Color is red!
>
> ...plus a warning, if warnings are on as they should. While an undef
> *can* be mistaken for a 0 (or a ""), there is a difference, and a
> program can tell which is which.
>
> [...]
>
> I have as yet not missed the functionality of UniqueID.
>
> Anno
------------------------------
Date: Sat, 03 Apr 2004 16:44:21 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: scope again
Message-Id: <406EE9A5.6010803@rochester.rr.com>
Bob Walton wrote:
> Richard Morse wrote:
>
>> In article <slrnc6je7l.ig8.xx087@smeagol.ncf.ca>,
>> Glenn Jackman <xx087@freenet.carleton.ca> wrote:
>
> ...
>
>
>>> % $s->fchsym
>>> tile is 'foo'
>>>
>>
>> Wait -- completely un-related to the question, what is this? How do
>> you get an interactive Perl?
>
>
>
> Windoze version:
>
> perl -e "print '% ',eval <STDIN>,print qq(\n) while 1"
Well, actually:
perl -e "print('% '),eval <STDIN>,print qq(\n) while 1"
works better.
>
>>
>> Ricky
>>
>>
>
>
>
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sat, 3 Apr 2004 19:04:55 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: test
Message-Id: <c4nvba$ng4$1@reader2.nmix.net>
"CatcherInTheRye" <letnomanenterhere@yahoo.co.kr> wrote in message
news:c4g8b5$akp@netnews.proxy.lucent.com...
> test
>
go away.
------------------------------
Date: Sat, 3 Apr 2004 10:10:00 -0600
From: "John" <john@newchester.com>
Subject: Re: UniqueID Module
Message-Id: <c4mnkv$ahp$1@news.f.de.plusline.net>
Here is a proposed implementation for the package:
use strict; use warnings;
package UniqueID;
our $VERSION = '1.01';
use Carp;
use overload
'==' => sub {my $class = ref(shift); croak "'==' operator isn't defined
for $class objects. Did you mean 'eq'?"},
'eq' => 'equals',
'!=' => sub {my $class = ref(shift); croak "'!=' operator isn't defined
for $class objects. Did you mean 'ne'?"},
'ne' => 'notequals',
nomethod => sub {
my($a, $b, $c, $operator) = @_;
my $class = ref($a);
croak "The '$operator' operation isn't defined for $class objects";
},
'""' => 'stringify'
;
sub stringify {
my($self) = @_;
return overload::StrVal($self).'='.$$self;
}
sub equals {
ref($_[1]) eq ref($_[0]) and ${$_[0]} eq ${$_[1]}
};
sub notequals {
not (ref($_[1]) eq ref($_[0]) and ${$_[0]} eq ${$_[1]})
};
sub name {
my($self) = @_;
my @parts = split /\:\:/, $$self;
return $parts[-1];
}
sub fullname {
my($self) = @_;
return $$self;
}
sub new {
my($pkg, $client_package, $name) = @_;
my $string = $client_package."::".$name;
my $self = bless \$string, $pkg;
return $self;
}
sub make_identifier {
my($pkg, $client_package, $name) = @_;
my $id = $pkg->new($client_package, $name);
no strict 'refs';
*{$client_package."::".$name} = sub {
$id;
};
}
sub import {
my($pkg, @names) = @_;
my $client_package = caller(0);
for(@names) {
$pkg->make_identifier($client_package, $_);
}
}
"John" <john@newchester.com> wrote in message
news:c4l9gc$2iqd$1@news.f.de.plusline.net...
> I need an alternative for 'use constant', but that allows the definition
of
> unique IDs not associated with scalar values.
>
> I propose the UniqueID class, summarized below. I'm asking this list:
>
> - Is this module necessary, or is there a better way to do this?
> - Is it aptly named?
> - Other comments before I post to CPAN?
>
>
> Synopsis:
>
> use UniqueID qw (red yellow blue);
>
> my $color = red;
>
> print "Just as we thought!\n" if $color == red;
> print "This will never happen!\n" if $color == blue;
> print "Nor will this!\n" if $color == 'red';
>
> print "Color is ".$color->name.".\n";
>
> $color + 1; #Raises an exception. Addition isn't defined for UniqueID
> objects.
>
> Output:
> Just as we thought!
> Color is red.
> The '+' operation isn't defined for UniqueID objects at C:\test5.pl line
11
>
>
> Rationale:
>
> UniqueID lets you define unique identifiers that are not associated with
> scalar values. Contrast this with the "constant" package, which simply
> aliases names to scalar values.
>
> UIDs are safer than constants, because they can not accidently be confused
> with un-related scalars. For example, the following accident might happen
> using aliased constants:
>
> use constant red => 0;
>
> my $color;
> my $color = red if not 1; #*Don't* set $color to red.
>
> #Comparing $color to red is the same as comparing it to 0.
> if($color == red) {
> print "Color is red!\n";
> } else {
> print "Color is NOT red!\n";
> }
>
> Output: Color is red!
>
> Whereas colors can never be confused with numbers if you use UIDs:
>
> use UniqueID qw (red);
>
> my $color = red if 0; #*Don't* set $color to red.
>
> ###Red doesn't equal 0 or undef.
> if($color == red) {
> print "Color is red!\n";
> } else {
> print "Color is NOT red!\n";
> }
>
> Output: Color is NOT red!
>
>
>
>
>
------------------------------
Date: Sat, 3 Apr 2004 19:06:45 -0800
From: "Robin" <webmaster@infusedlight.net>
Subject: Re: Writing to STDIN
Message-Id: <c4nvbb$ng4$2@reader2.nmix.net>
bad, bad idea....that could make your computer go nuts on you.
-Robin
------------------------------
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 6359
***************************************