[15544] in Perl-Users-Digest
Perl-Users Digest, Issue: 2955 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 5 12:17:11 2000
Date: Thu, 4 May 2000 21:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <957499508-v9-i2955@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 4 May 2000 Volume: 9 Number: 2955
Today's topics:
Re: #!/usr/bin/perl question (Tad McClellan)
Re: #!/usr/bin/perl question msouth@fulcrum.org
Re: crypt problems (Bart Lateur)
Re: crypt problems <s2mdalle@titan.vcu.edu>
Good Perl website? <Tse_Ng@hotmail.com>
Help Again---Still a easy CGI program <webmaster@harbinonline.com>
Re: Help Again---Still a easy CGI program <jeff@vpservices.com>
Re: how do I open it (Craig Berry)
Re: How to find a matching ")"? (Steve)
Re: How to tell if <> operator will work on a given sca (Bart Lateur)
Re: making a package (NOT a module) (Bart Lateur)
Re: more than one way to do it? <Jonathan.L.Ericson@jpl.nasa.gov>
Re: more than one way to do it? <nospam@devnull.com>
no error messages when there should be brondsem@my-deja.com
Re: no error messages when there should be (Tad McClellan)
Re: no error messages when there should be <jeff@vpservices.com>
Perl 5.6 stable?? bryan@NoSpam.panix.com
Re: Q: search/replace and pattern matching <phill@modulus.com.au>
Re: tesxtarea input to <p>paragraph</p> format -- how? <lr@hpl.hp.com>
Re: tesxtarea input to <p>paragraph</p> format -- how? <nospam@devnull.com>
Re: Validating URLs <s2mdalle@titan.vcu.edu>
XML::RSSLite sample program scott@industrial-linux.org
XML::RSSLite sample program scott@industrial-linux.org
XML::RSSLite sample program scott@industrial-linux.org
XML::RSSLite sample program scott@industrial-linux.org
XML::RSSLite sample program scott@industrial-linux.org
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 4 May 2000 22:11:40 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: #!/usr/bin/perl question
Message-Id: <slrn8h4bes.41m.tadmc@magna.metronet.com>
On Thu, 04 May 2000 22:03:28 GMT, David Ness <DNess@Home.Com> wrote:
>anon wrote:
>>
>> I have been getting into perl for the last two weeks without a problem but I
>> am confused as to why the base path to perl begins with a hash ?
>>
>> ie. #!/usr/bin/perl
>It's a Unix `special thing'.
It depends on "who" is looking at it.
On Unix, the very first 2 characters of a file are called
a "magic number". The magic number that corresponds to the
"#!" two-character string is used to execute interpreters.
>The line _is_ a comment if you say
>`perl garf' about the file,
When Perl looks at it, it sees a comment.
>but if you use unix shell to `execute' the file,
>it is interpreted
When Unix looks at it, it sees a magic number.
>by the shell as the `command to execute'. This (sort of)
^^^^^^^^^^^^
It is done by the kernel, not the shell though (that's
why you need a full file spec, the kernel has no
concept of "path").
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 May 2000 03:11:41 GMT
From: msouth@fulcrum.org
Subject: Re: #!/usr/bin/perl question
Message-Id: <8ete5d$5mv$1@inxs.ncren.net>
David Ness <DNess@home.com> wrote:
> anon wrote:
>>
>> I have been getting into perl for the last two weeks without a problem but I
>> am confused as to why the base path to perl begins with a hash ?
>>
>> ie. #!/usr/bin/perl
>>
>> I'm not a programmer but I understood that # means comments and anything
>> after it does not effect the running of the program.
>>
>> However, it does have an effect as when some perl scripts come with
>> #!/usr/local/bin/perl, it needs to be amended or they won't work.
>>
>> Anybody wish to enlighten me.
> It's a Unix `special thing'. The line _is_ a comment if you say
> `perl garf' about the file, but if you use unix shell to `execute' the file,
Well, not _just_ a comment. You could put
#!/totally/bogus/path/to/perl -w
print $yo;
in file 'foo' and run it with 'perl foo' and it would give you
the warnings about using $yo only once and using an uninitialized
variable (which is a long-winded way of saying "-w would be in effect").
and if you replace it with
#!/totally/bogus/path/to/PERL -w
you'll see that there really _is_ no such thing as PERL...
Okay, the responsible thing would be just to point yo to
perldoc perlrun
like the first guy that responded did. That first line is rather
magic-laden.
YARTUL (yet another reason to use linux)
--
Michael South | http://fulcrum.org
Head Mathophile, | 101 Canyon Run
fulcrum.org | Cary NC 27513 USA
(msouth@fulcrum.org) | (919) 465-9074
------------------------------
Date: Fri, 05 May 2000 01:44:29 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: crypt problems
Message-Id: <391826a3.15077846@news.skynet.be>
douceur wrote:
>I'm making a cgi script that uses encrypted passwords. But I'm having
>a problem with the crypt() function. When I use it in one area of the
>script, and then I use it in another area of the script (with the same
>password), it gives different values.
You're using the same "salt" value too, I hope?
If you use crypt() with the same two arguments, it should always produce
the same value. At least, as long as you remain on one and the same
system. On a different system, you can get a different result.
--
Bart.
------------------------------
Date: Thu, 04 May 2000 21:46:57 -0500
From: "David Allen" <s2mdalle@titan.vcu.edu>
Subject: Re: crypt problems
Message-Id: <8etcnp$khk$6@bob.news.rcn.net>
In article <04157000.3a8cc8e1@usw-ex0106-044.remarq.com>, douceur
<douceurNOdoSPAM@flashmail.com.invalid> wrote:
> I'm making a cgi script that uses encrypted passwords. But I'm having a
> problem with the crypt() function. When I use it in one area of the
> script, and then I use it in another area of the script (with the same
> password), it gives different values. I therefore can't use the same
> password file, although I'm sure that I should be able to. Any help
> would be appreciated.
What crypt outputs depends on two things - the 'salt' and the
cleartext. Not just the cleartext.
So, crypt("foobar", "h") and crypt("foobar", "i") have different
values even though they're both crypting the word foobar.
Check the salt value to make sure they're the same. Also,
if you crypt() something with something other than the
salt that was originally used to crypt the word, you'll get
something different.
--
David Allen
http://opop.nols.com/
----------------------------------------
Firearms are second only to the Constitution in importance; they are the
peoples' liberty's teeth.
-- George Washington
------------------------------
Date: Fri, 05 May 2000 03:54:49 GMT
From: Tse <Tse_Ng@hotmail.com>
Subject: Good Perl website?
Message-Id: <8etgm4$mef$1@nnrp1.deja.com>
Hi,
Anyone know of any good Perl reference web site?
Please email me: tse_ng@hotmail.com
--
Thanks in advance.
Cheers,
Tse
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 5 May 2000 10:49:03 +0800
From: "bentium" <webmaster@harbinonline.com>
Subject: Help Again---Still a easy CGI program
Message-Id: <8etcgd$1v6h$1@news.cz.js.cn>
hi,there
Thank u for u help.
The first line of the program is sure "#!/usr/bin/perl -T"
But when i execute it , it appeared the error "Too later for '-T' option
at commerce.cgi line 1.
I am using RedHat 6.1 It that error because of the configuration of
something related to RH6.1 ?
Hope u can give me a hand , thank u again!
wei
------------------------------
Date: Thu, 04 May 2000 20:40:42 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help Again---Still a easy CGI program
Message-Id: <391242BA.562970A1@vpservices.com>
bentium wrote:
>
> hi,there
>
> Thank u for u help.
> The first line of the program is sure "#!/usr/bin/perl -T"
> But when i execute it , it appeared the error "Too later for '-T' option
> at commerce.cgi line 1.
>
> I am using RedHat 6.1 It that error because of the configuration of
> something related to RH6.1 ?
>
> Hope u can give me a hand , thank u again!
>
> wei
All Perl error messages are listed in the perldiag documentation. Type
"perldoc perldiag" at the command line and scroll till you get to the T
section. It explains in quite a bit of detail why this error occurs and
what to do about it. The short answer is, instead of typing "perl
foo.pl" on the command line when you invoke the script, type "perl -T
foo.pl".
--
Jeff
------------------------------
Date: Fri, 05 May 2000 01:22:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how do I open it
Message-Id: <sh48ieprgbn140@corp.supernews.com>
Crisper (burnt@ix.netcom.com) wrote:
: I have a flat file database (tab delimited) that looks like this:
:
: Date Name Address1
: 15:27 PM Apr 12 First Name etc.
: 00:24 AM May 13 Second Name etc.
: 16:27 PM Jun 02 Third Name etc.
:
: How do I open this file (using OPEN (FH, filename)) and retrive only
The function name is actually 'open'. Case matters in perl. Also, be
sure to check the success of open.
: the rows with certain characteristics (for example, matching something
: like =~/Apr/ ? )
For large files:
my @matches;
/Apr/ && push @matches, $_ while <>;
For short files:
my @matches = grep /Apr/, <>;
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "The road of Excess leads to the Palace
of Wisdom" - William Blake
------------------------------
Date: 5 May 2000 01:16:03 GMT
From: sjlen@ndirect.co.uk (Steve)
Subject: Re: How to find a matching ")"?
Message-Id: <slrn8h40ie.13q.sjlen@zero-pps.localdomain>
On Thu, 4 May 2000 10:04:11 -0700, Larry Rosler wrote:
>In article <slrn8h2u01.vi1.sjlen@zero-pps.localdomain> on 4 May 2000
>15:06:07 GMT, Steve <sjlen@ndirect.co.uk> says...
>
>...
>
>> push (@the_names, $_);
>>
>> This will put the names into an array. Then print them out:
>>
>> while (<@the_names>)
>> {
>> print "$_ \n";
>> }
>
>Huh? You do know that <...> is the operator to read a line from a
>filehandle, don't you?
while (<@the_names>)
Works without error messages in the instances I've used it.
while (@the_names)
It doesn't like this "Use of uninitialized value in concatenation
(.) at ./testbed line 31." prints this untill you CTRL-C.
foreach (@the_names)
It don't complain about this one.
--
Cheers
Steve email mailto:sjlen@ndirect.co.uk
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.ndirect.co.uk/~sjlen/
or http://start.at/zero-pps
11:58pm up 8 days, 1:59, 3 users, load average: 1.10, 1.08, 1.02
------------------------------
Date: Fri, 05 May 2000 01:26:45 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to tell if <> operator will work on a given scalar?
Message-Id: <391722ec.14127149@news.skynet.be>
Eryq wrote:
>Suppose someone gives me $fh, and I want to know
>whether or not
>
> <$fh>
>
>will be a problem.... *without* actually executing it.
>I.e.: is $fh a real or tied filehandle?
Look up "fileno" in perlfunc. It might just do what you want.
--
Bart.
------------------------------
Date: Fri, 05 May 2000 01:24:04 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: making a package (NOT a module)
Message-Id: <3916213f.13697855@news.skynet.be>
Sirena Boden wrote:
>I am putting together a perl5 script with certain suid restrictions that
>make it impossible for me to keep the entire script in one file. I
>would like to package two files, one with subroutines and global vars
>for the other to use.
Er... that doesn't seem to make sense. Any packages you create in Perl,
run under the same user. You can't SUID one package and not the other.
Would you need, I think, is create different scripts, and one calling
the other. I'd say: the normal script calling the setuid script.
So, you cannot really "share variables". You can save data in files to
share, use a simple command line, or find another way to communicate:
maybe through sockets, or pipes (see perlfunc -> "open"). To keep things
simple, best is to reduce the communication to the absolute minimum
necessary.
--
Bart.
------------------------------
Date: Thu, 04 May 2000 17:43:49 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
To: The WebDragon <nospam@devnull.com>
Subject: Re: more than one way to do it?
Message-Id: <39121945.DBEA499C@jpl.nasa.gov>
The WebDragon wrote:
> $mapDir = param('mapstyle') || "ERROR" if param('mapstyle') eq '--CHOOSE
> ONE--';
>
> looks great, less filling, breaks at runtime.
>
> how do I write this properly?
What are you trying to do?
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: 5 May 2000 01:40:07 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: more than one way to do it?
Message-Id: <8et8pn$446$0@216.155.33.19>
In article <39121C11.E9F444C5@vpservices.com>, Jeff Zucker
<jeff@vpservices.com> wrote:
| The WebDragon wrote:
|
| > apparently there's more than enough WRONG ways to do it,
| > as well as the 'right ways'
| >
| > $mapDir = param('mapstyle')
| > || "ERROR" if param('mapstyle') eq '--CHOOSE ONE--';
| >
| > looks great, less filling, breaks at runtime.
| >
| > how do I write this properly?
|
|
$mapDir = (
param('mapstyle') eq '--CHOOSE ONE--'
? "ERROR"
: param('mapstyle')
);
perfect.. $mapDir is declared via my(); at the beginning of the script,
so no sweat there.
gracias :)
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Fri, 05 May 2000 02:41:32 GMT
From: brondsem@my-deja.com
Subject: no error messages when there should be
Message-Id: <8etccq$hjc$1@nnrp1.deja.com>
Whenever I run a perl script that is not correct, I recieve a web page
with a message like to "'D:\www\web\cgi-bin\testdisp3.pl' script
produced no output". I would really like to see the actual errors.
Is this a problem with the Perl configuration? or is it more likely
that the actual web server is producing the message?
The server is running ActivePerl 5.00503 on NT.
Any help here would be a great benefit in debugging.
Thanks,
Dave Brondsema
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 4 May 2000 22:37:02 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: no error messages when there should be
Message-Id: <slrn8h4cue.43t.tadmc@magna.metronet.com>
On Fri, 05 May 2000 02:41:32 GMT, brondsem@my-deja.com <brondsem@my-deja.com> wrote:
>Whenever I run a perl script that is not correct, I recieve a web page
>with a message like to "'D:\www\web\cgi-bin\testdisp3.pl' script
>produced no output". I would really like to see the actual errors.
They are probably being put into a log file somewhere.
Ask your system administrator where.
>Is this a problem with the Perl configuration?
No.
>Any help here would be a great benefit in debugging.
type this:
perldoc CGI::Carp
and then use "fatalsToBrowser".
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 04 May 2000 20:44:36 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: no error messages when there should be
Message-Id: <391243A4.C8C11D83@vpservices.com>
brondsem@my-deja.com wrote:
>
> Whenever I run a perl script that is not correct, I recieve a web page
> with a message like to "'D:\www\web\cgi-bin\testdisp3.pl' script
> produced no output". I would really like to see the actual errors.
>
> Is this a problem with the Perl configuration? or is it more likely
> that the actual web server is producing the message?
Put this line near the top of your scripts: use CGI::Carp
qw(fatalsToBrowser);
That will send many (but not all) errors to the browser. "No output"
probably means what it says - that your script ran but didn't send a
content type or other output to the browser. In that case, it is
possible that there were no errors in the script's performance, only
errors in what the programmer told (or didn't tell) the script to do
:-).
--
Jeff
------------------------------
Date: 5 May 2000 02:26:29 GMT
From: bryan@NoSpam.panix.com
Subject: Perl 5.6 stable??
Message-Id: <8etbgl$5ik$2@news.panix.com>
I known this is considered a stable and Production release, but since I don't
known when it was released - is a 5.6.1 coming anytime soon? I have a feeling
the answer will be go with 5.6.
And finally a number scheme I understand (BSD even/odd)! :)
------------------------------
Date: Fri, 05 May 2000 06:58:06 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Q: search/replace and pattern matching
Message-Id: <3911E45E.7A61@modulus.com.au>
Bart Lateur wrote:
>
> Jonathan Stowe wrote:
>
> >> $address =~ s/[^\w\.-@]//g;
> >
> >So you dont think that my colleague £@gellyfish.com should get any mail then ?
>
> Or
>
> "great chips"@potato.com
>
> Uh, at least I think that's a validly formed e-mail address.
>
> --
> Bart.
bart.lateur@skynet.be (Bart Lateur)
is a valid email address according to RFC 822
but after $address =~ s/[^\w\.-@]//g; it is
bart.lateur@skynet.beBartLateur
which isn't.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Thu, 4 May 2000 18:33:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: tesxtarea input to <p>paragraph</p> format -- how?
Message-Id: <MPG.137bc4aa872b1cb798aa07@nntp.hpl.hp.com>
In article <8et5vm$sor$0@216.155.33.19> on 5 May 2000 00:52:06 GMT, The
WebDragon <nospam@devnull.com> says...
> In article <MPG.137b770f216a52c498aa03@nntp.hpl.hp.com>, Larry Rosler
> <lr@hpl.hp.com> wrote:
...
> so, to see if I've got this straight (and thanks again for all the help
> Larry -- kudos in the script comments when finished =)
>
> if I have something produced from a CGI.pm-using script taken as
> regurgitated values in param(), I could do something like this?
>
> {
> local $/ = ""; # Set 'paragraph mode' -- see perlvar.
> $reviewText = map { chomp; "<p>$_</p>\n" } param('reviewtext');
> }
> $reviewText =~ s/\n/<br>\n/g;
>
> (barely educated guess, but I'm learning)
>
> that look about right?
Not at all. I misread the requirements.
The paragraph mode works for input from a file. But evidently you are
processing a string. The best thing to use for that is a split() on two
or more newlines in sequence.
Furthermore, the output of the map() is a list of strings, not a scalar.
Each of the strings comprises one paragraph. If you want to process
them later as a single string, user the join() function:
my $review_text = join "" => map { s/\n/<br>\n/g; "<p>$_</p>\n" }
split /\n\n+/ => param('reviewtext');
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 5 May 2000 01:46:16 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: tesxtarea input to <p>paragraph</p> format -- how?
Message-Id: <8et958$446$1@216.155.33.19>
In article <8et5vm$sor$0@216.155.33.19>, The WebDragon
<nospam@devnull.com> wrote:
| so, to see if I've got this straight (and thanks again for all the help
| Larry -- kudos in the script comments when finished =)
|
| if I have something produced from a CGI.pm-using script taken as
| regurgitated values in param(), I could do something like this?
|
| {
| local $/ = ""; # Set 'paragraph mode' -- see perlvar.
| $reviewText = map { chomp; "<p>$_</p>\n" } param('reviewtext');
| }
| $reviewText =~ s/\n/<br>\n/g;
|
| (barely educated guess, but I'm learning)
|
| that look about right?
yagh. I'm such a newbie ..
THIS is what works :
[snip]
# kudos to lr@hpl.hp.com (Just Another Larry) Rosler, for the skinny on
this little gem
{
local $/ = ""; # Set 'paragraph mode' -- see perlvar.
@reviewText = map { chomp; "<p>$_</p>\n" } param('reviewtext');
}
foreach (@reviewText) {s/\n/<br>\n/g};
print p( b('Review Text Body'));
foreach (@reviewText) {
print shift(@reviewText);
};
[snip]
thanks again :)
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Thu, 04 May 2000 21:42:49 -0500
From: "David Allen" <s2mdalle@titan.vcu.edu>
Subject: Re: Validating URLs
Message-Id: <8etcg1$khk$5@bob.news.rcn.net>
In article <3911DE58.A59440E4@surfaid.org>, Greg Griffiths
<greg2@surfaid.org> wrote:
> is there a way to connect to these from a PERL script and check for a
> return code such as a 404 ?
Yes - and it's pretty easy. The quickest way to grab a URL:
use LWP::Simple;
print get('http://www.foobar.com/somefile.html');
You can check the perldoc pages of LWP::UserAgent, LWP::Simple,
and a few others for more details.
--
David Allen
http://opop.nols.com/
----------------------------------------
Firearms are second only to the Constitution in importance; they are the
peoples' liberty's teeth.
-- George Washington
------------------------------
Date: Thu, 04 May 2000 22:14:24 -0600
From: scott@industrial-linux.org
Subject: XML::RSSLite sample program
Message-Id: <n0rQ4.2282$Pz6.810610@feed.centuryinter.net>
I realized it must have been hard to see how simple RSSLite was to use since
I haven't polished up the synopsis yet. You will find the simple program below at:
http://industrial-linux.org/RSSLite/sample.pl
It prints the title/desc/url for both the channel and items contained in any
RSS/RDF/scriptingNews/Weblog metafile. Enjoy!
---scott
#!/usr/bin/perl -w -I.
use LWP::Simple;
use RSSLite;
my $content = get('http://www.vex.net/parnassus/parnassus.rss')
or die "Can't get the content!";
my %result;
parseXML(\%result, \$content);
print "=== Channel ===\n",
"Title: $result{'title'}\n",
"Desc: $result{'description'}\n",
"Link: $result{'link'}\n\n";
my $item;
foreach $item (@{$result{'items'}}) {
print " --- Item ---\n",
" Title: $item->{'title'}\n",
" Desc: $item->{'description'}\n",
" Link: $item->{'link'}\n\n";
}
------------------------------
Date: Thu, 04 May 2000 22:14:34 -0600
From: scott@industrial-linux.org
Subject: XML::RSSLite sample program
Message-Id: <w0rQ4.2283$Pz6.810610@feed.centuryinter.net>
I realized it must have been hard to see how simple RSSLite was to use since
I haven't polished up the synopsis yet. You will find the simple program below at:
http://industrial-linux.org/RSSLite/sample.pl
It prints the title/desc/url for both the channel and items contained in any
RSS/RDF/scriptingNews/Weblog metafile. Enjoy!
---scott
#!/usr/bin/perl -w -I.
use LWP::Simple;
use RSSLite;
my $content = get('http://www.vex.net/parnassus/parnassus.rss')
or die "Can't get the content!";
my %result;
parseXML(\%result, \$content);
print "=== Channel ===\n",
"Title: $result{'title'}\n",
"Desc: $result{'description'}\n",
"Link: $result{'link'}\n\n";
my $item;
foreach $item (@{$result{'items'}}) {
print " --- Item ---\n",
" Title: $item->{'title'}\n",
" Desc: $item->{'description'}\n",
" Link: $item->{'link'}\n\n";
}
------------------------------
Date: Thu, 04 May 2000 22:15:11 -0600
From: scott@industrial-linux.org
Subject: XML::RSSLite sample program
Message-Id: <61rQ4.2284$Pz6.810610@feed.centuryinter.net>
I realized it must have been hard to see how simple RSSLite was to use since
I haven't polished up the synopsis yet. You will find the simple program below at:
http://industrial-linux.org/RSSLite/sample.pl
It prints the title/desc/url for both the channel and items contained in any
RSS/RDF/scriptingNews/Weblog metafile. Enjoy!
---scott
#!/usr/bin/perl -w -I.
use LWP::Simple;
use RSSLite;
my $content = get('http://www.vex.net/parnassus/parnassus.rss')
or die "Can't get the content!";
my %result;
parseXML(\%result, \$content);
print "=== Channel ===\n",
"Title: $result{'title'}\n",
"Desc: $result{'description'}\n",
"Link: $result{'link'}\n\n";
my $item;
foreach $item (@{$result{'items'}}) {
print " --- Item ---\n",
" Title: $item->{'title'}\n",
" Desc: $item->{'description'}\n",
" Link: $item->{'link'}\n\n";
}
------------------------------
Date: Thu, 04 May 2000 22:15:23 -0600
From: scott@industrial-linux.org
Subject: XML::RSSLite sample program
Message-Id: <h1rQ4.2285$Pz6.810610@feed.centuryinter.net>
I realized it must have been hard to see how simple RSSLite was to use since
I haven't polished up the synopsis yet. You will find the simple program below at:
http://industrial-linux.org/RSSLite/sample.pl
It prints the title/desc/url for both the channel and items contained in any
RSS/RDF/scriptingNews/Weblog metafile. Enjoy!
---scott
#!/usr/bin/perl -w -I.
use LWP::Simple;
use RSSLite;
my $content = get('http://www.vex.net/parnassus/parnassus.rss')
or die "Can't get the content!";
my %result;
parseXML(\%result, \$content);
print "=== Channel ===\n",
"Title: $result{'title'}\n",
"Desc: $result{'description'}\n",
"Link: $result{'link'}\n\n";
my $item;
foreach $item (@{$result{'items'}}) {
print " --- Item ---\n",
" Title: $item->{'title'}\n",
" Desc: $item->{'description'}\n",
" Link: $item->{'link'}\n\n";
}
------------------------------
Date: Thu, 04 May 2000 22:15:43 -0600
From: scott@industrial-linux.org
Subject: XML::RSSLite sample program
Message-Id: <C1rQ4.2286$Pz6.810610@feed.centuryinter.net>
I realized it must have been hard to see how simple RSSLite was to use since
I haven't polished up the synopsis yet. You will find the simple program below at:
http://industrial-linux.org/RSSLite/sample.pl
It prints the title/desc/url for both the channel and items contained in any
RSS/RDF/scriptingNews/Weblog metafile. Enjoy!
---scott
#!/usr/bin/perl -w -I.
use LWP::Simple;
use RSSLite;
my $content = get('http://www.vex.net/parnassus/parnassus.rss')
or die "Can't get the content!";
my %result;
parseXML(\%result, \$content);
print "=== Channel ===\n",
"Title: $result{'title'}\n",
"Desc: $result{'description'}\n",
"Link: $result{'link'}\n\n";
my $item;
foreach $item (@{$result{'items'}}) {
print " --- Item ---\n",
" Title: $item->{'title'}\n",
" Desc: $item->{'description'}\n",
" Link: $item->{'link'}\n\n";
}
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 2955
**************************************