[26488] in Perl-Users-Digest
Perl-Users Digest, Issue: 8649 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 9 18:05:34 2005
Date: Wed, 9 Nov 2005 15:05:08 -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 Wed, 9 Nov 2005 Volume: 10 Number: 8649
Today's topics:
Re: how to do this job using perl? <nobull@mail.com>
How to find a module's path on a server <syncwa@gmail.com>
Re: How to find a module's path on a server <noreply@gunnar.cc>
RSS <sgier@nospam.ch>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 09 Nov 2005 20:03:19 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: how to do this job using perl?
Message-Id: <dktkm9$bgt$1@slavica.ukpost.com>
sonet wrote:
> 01.attr 0
> 02.attr 0
> 04.attr 01.attr
> 03.attr 01.attr
> 06.attr 02.attr
> 07.attr 03.attr
> 08.attr 03.attr
> 09.attr 07.attr
> =========================================
> transform to this form
> =========================================
> 01.attr
> 04.attr
> 03.attr
> 07.attr
> 09.attr
> 08.attr
> 02.attr
use strict;
use warnings;
my %children;
sub r {
my ($depth, $items) = @_;
return unless $items;
for ( @$items ) {
print " " x $depth, "$_\n";
r($depth+1,$children{$_});
}
}
while (<DATA>) {
my ($child,$parent) = /(.*) (.*)/ or die;
push @{$children{$parent}} => $child;
}
r(0,$children{0});
__DATA__
01.attr 0
02.attr 0
04.attr 01.attr
03.attr 01.attr
06.attr 02.attr
07.attr 03.attr
08.attr 03.attr
09.attr 07.attr
------------------------------
Date: Thu, 10 Nov 2005 06:10:06 +0800
From: syncwa <syncwa@gmail.com>
Subject: How to find a module's path on a server
Message-Id: <2ss4n191hr3odp48dgn76d42t7kjk46db1@4ax.com>
Hi,
How can I find a module 's path on a server?
I know I can use it, but would like to find out it's absolute path.
Thanks
------------------------------
Date: Wed, 09 Nov 2005 23:15:14 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to find a module's path on a server
Message-Id: <3tfanjFs3i6mU1@individual.net>
syncwa wrote:
> How can I find a module 's path on a server?
> I know I can use it, but would like to find out it's absolute path.
use Some::Module;
print $INC{'Some/Module.pm'};
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 09 Nov 2005 23:16:43 +0100
From: Michael Sgier <sgier@nospam.ch>
Subject: RSS
Message-Id: <pan.2005.11.09.22.16.40.435559@nospam.ch>
Hello
if someone could check out why the heise english news doesn't work would be great. Below
at the end is the working original german version.
Many THANKS and regards
Michael
PS: I would be also grateful for one or two other english news RSS
implementations ( Yahoo? or more specific (Linux)games for my site. See
the german version in the link section of: http://shop.sgier.com ).
sub news {
local($x,$js,$top) = @_;
if($x eq "heise online English news"){# Heise online english news
my $heise online English news = get("http://www.heise.de/english/newsticker/news.rdf");
foreach my $i (split /<item>/,$heise online English news){
my($titel) = ($i =~ m!<title>(.+?)</title>!ig);
my($url) = ($i =~ m!<link>(.+?)</link>!ig);
if($titel ne "" && $url ne "" && $url ne "http://www.heise.de/newsticker/news/"){
$heisenews .= qq~$url\|$titel\n~;
}
}
return($heisenews);
}elsif($x eq "golem"){# Golem News
my $golem = get("http://www.golem.de/golem_backend.rdf");
foreach my $i (split /<item>/,$golem){
my($titel) = ($i =~ m!<title>(.+?)</title>!ig);
my($url) = ($i =~ m!<link>(.+?)</link>!ig);
if($titel ne "" && $url ne "" && $url ne "http://www.golem.de"){
$golemnews .= qq~$url\|$titel\n~;
}
}
return($golemnews);
}elsif($x eq "telepolis"){# Telepolis
my $telepolis = get("http://www.heise.de/tp/news.rdf");
while($telepolis =~ /\<item\>(.*?)\<\/item\>/sg){
$i = $1;
$titel = $1 if($i =~ /<title>(.*)<\/title>/i);
$url = $1 if($i =~ /<link>(.*)<\/link>/i);
if($titel ne "" && $url ne "" && $url ne "http://www.telepolis.de/"){
$telenews .= qq~$url\|$titel\n~;
}
}
return($telenews);
}
}
if($x eq "heise"){# Heise News
my $heise = get("http://www.heise.de/newsticker/heise.rdf");
foreach my $i (split /<item>/,$heise){
my($titel) = ($i =~ m!<title>(.+?)</title>!ig);
my($url) = ($i =~ m!<link>(.+?)</link>!ig);
if($titel ne "" && $url ne "" && $url ne "http://www.heise.de/newsticker/"){
$heisenews .= qq~$url\|$titel\n~;
}
}
return($heisenews);
------------------------------
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 8649
***************************************