cajun has asked for the wisdom of the Perl Monks concerning the following question:
I got this piece of code from here a while back. (I looked for the code again to give the author credit, but couldn't find it) I modified it to work in a browser (one line, big mod).
If I run this from a terminal window, everything works as it should, i.e.:
node 1
node 2
node 3
However, if I run it from within a browser, the nodes are displayed as follows:
node 1 node 2 node 3
I've looked at it and haven't been able to figure out the difference yet. Can someone please explain ?
Thanks !#!/usr/bin/perl -w use LWP::Simple; $/ = undef; my $slurp = get("http://www.perlmonks.org/headlines.rdf"); push @node, [$1,$2] while $slurp =~ /<item>\s*<title\s*>([^<]*)<\/title>\s*<link\s*>([^< + +]*)/gio; print "Content-type: text/html\n\n"; print map { "<a href=\"$_->[1]\">$_->[0]</a>\n" } @node;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perlmonks-topstories
by extremely (Priest) on Oct 07, 2000 at 13:36 UTC | |
|
RE: perlmonks-topstories
by turnstep (Parson) on Oct 07, 2000 at 17:33 UTC | |
|
Re: perlmonks-topstories
by cajun (Chaplain) on Oct 08, 2000 at 23:06 UTC |