[19559] in Perl-Users-Digest
Perl-Users Digest, Issue: 1754 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 16 03:05:45 2001
Date: Sun, 16 Sep 2001 00: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)
Message-Id: <1000623905-v10-i1754@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 16 Sep 2001 Volume: 10 Number: 1754
Today's topics:
Re: AoH - continued (Xus Noitcurtsed sSaM)
Re: AoH - continued <dtweed@acm.org>
gd.pm 1.33 and gd1.8.4 (LBL)
Re: I am Adam H. Kerman your new god <whamera@home.com>
Re: Mail parser: Can it be faster? <bcaligari@fireforged.com>
Re: Mail parser: Can it be faster? <bcaligari@fireforged.com>
Re: Please help, It did'nt help. <Laocoon@eudoramail.com>
Re: print name of var <bwalton@rochester.rr.com>
Re: Q: When to use eval for calling object subroutines? (B Wooster)
Re: Using 'use lib' to throw an arbitrary directory int <jeff@vpservices.com>
Using 'use lib' to throw an arbitrary directory into @I <nospam@newsranger.com>
Re: Using 'use lib' to throw an arbitrary directory int <bkennedy99@Home.com>
Re: Using 'use lib' to throw an arbitrary directory int (David Efflandt)
XML::XSLT - 'Can't call method "getNodeValue" on an und (Jay McGavren)
Re: XML::XSLT - 'Can't call method "getNodeValue" on an (Stefan Ram)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 15 Sep 2001 15:36:39 GMT
From: lost@earth.com (Xus Noitcurtsed sSaM)
Subject: Re: AoH - continued
Message-Id: <3ba3744e.122289966@news.coserv.net>
On Fri, 14 Sep 2001 18:35:56 GMT, Dave Tweed <dtweed@acm.org> wrote:
>You would need to check $filename to make sure it doesn't include
>directory separators. You don't want to allow things like
> ../../../etc/passwd
I remember reading some where not to try and combat all the things
that you don't want to allow, but to only allow the things you want.
So, with that approach:
...
my $db_dir = '/usr/local/DB/';
$filename = $q->param("db_file") || $filename; #query or default
die("Nice Try!") if (!($db =~ m!\Q$db_dir\E([a-zA-Z_]+)\.dat!i ));
open(FILE,"<${db_dir}$db_file") || die($!);
...
I'm only in the 2nd chapter of Mastering Regular Expressions, so tips
on my regx would, of course, be appreciated.
tuNNe|ing
------------------------------
Date: Sun, 16 Sep 2001 02:32:58 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: AoH - continued
Message-Id: <3BA40E1E.7CEF23D5@acm.org>
Xus Noitcurtsed sSaM wrote:
> I remember reading some where not to try and combat all the things
> that you don't want to allow, but to only allow the things you want.
Take that to its logical conclusion, then: read the directory $db_dir
and only accept file names that appear there. Here's one way to do that:
my $db_dir = '/usr/local/DB/';
my %db_names;
# this open will succeed unless your directory structure is messed up
opendir (DIR, $db_dir) || return_an_error_message;
$db_names{$_} = 1 for grep -f $db_dir.$_, readdir DIR;
closedir DIR;
$filename = $q->param("db_file") || $filename; #query or default
return_an_error_message unless exists $db_names{$filename};
# this is virtually guaranteed to succeed because of validation above
open (FILE, $db_dir.$filename) || die($!);
> I'm only in the 2nd chapter of Mastering Regular Expressions, so tips
> on my regx would, of course, be appreciated.
Regex not really needed in this case.
-- Dave Tweed
------------------------------
Date: 15 Sep 2001 20:23:25 -0700
From: lblabrat@yahoo.com (LBL)
Subject: gd.pm 1.33 and gd1.8.4
Message-Id: <d79b5581.0109151923.62eb2990@posting.google.com>
Hello,
For the past two days I have been pulling my hair out trying to get
gd.pm installed. I have hit a wall and would like to bounce this off
of the bright perl commmunity out there, in hopes of finding any
leads. So here goes...
OS: Solaris 8
Perl: 5.6.1
Compiler: gcc 2.95.3
Installed pre-reqs:
jpeg-6b-sol8-sparc-local.gz*
libpng-1.0.11-sol8-sparc-local.gz*
zlib-1.1.3-sol8-sparc-local*
gnuplot-3.7.1-sol8-sparc-local.gz*
gtk+-1.2.10-sol8-sparc-local.gz
gdb-5.0-sol8-sparc-local.gz*
freetype-1.3.1-sol8-sparc-local.gz*
I know some of the above aren't required, but I have them on my
system.
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
I am using the patch_gd.pl script that comes with the GD.pm1.33 module
to setup Tom Boutell's gd1.8.4 to work with GNU autoconf and create
the .so files that perl expects.
I am able to run patch_gd.pl just fine.
The next step according to the README file is to run configure, which
I do as follows:
./configure --enable-jpeg --enable-freetype --enable-xpm
This does its bit for a while and then croaks with the following:
checking for a BSD compatible install... ./install-sh -c
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers
checking for main in -lm... no
checking for deflate in -lz... no
configure: error: libz not found.
I looked at the config.log file and noticed the following:
configure:1505: checking for a BSD compatible install
configure:1558: checking how to run the C preprocessor
configure:1579: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1642: checking for X
configure:1709: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1785: gcc -o conftest -g -O2 conftest.c -lXt 1>&5
configure:1876: checking for main in -lm
configure:1891: gcc -o conftest -g -O2 -I${prefix}/include -I
-L${exec_prefix}
/lib -L conftest.c -lm 1>&5
Undefined first referenced
symbol in file
main
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/
2.95.3/crt1.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 1884 "configure"
#include "confdefs.h"
It appears that the "checking for main in -lm... no" line that
appeared on stdout while configure was running, is where the error
occured and it points to ctrl.o file in the gcc-lib subtree. Is my gcc
whacked?
Any ideas will be immensely appreciated. I am "this" close to
implementing GD.pm 1.19 that doesn't have the above issues - but of
course doesn't do jpeg and png formats either.
Thanks in advance...
-Vic
------------------------------
Date: Sun, 16 Sep 2001 05:35:12 GMT
From: "Paul" <whamera@home.com>
Subject: Re: I am Adam H. Kerman your new god
Message-Id: <kSWo7.5$oD.23182@news1.rsm1.occa.home.com>
Fuck You...
"Adam H. Kerman" <ahk@chinet.chinet.com> wrote in message
news:5c517d5a.b1ced549@webty.sd.us...
> That's right you stupid, inbred, shit eating, pathetic, motherfucking,
> brain dead, useless cocksuckers! I'm taking over all of Usenet! There
> isn't a fucking thing you can do about it either! You're all a bunch
> of worthless scumbags, and now you will all answer to me! If you don't
> like this fact TOO FUCKING BAD! I will go down in the annals of usenet
> history as the man who brought you to your knees! Now get down on your
> knees and pay proper tribute to my glorious self!
>
> I AM ADAM H. KERMAN LORD AND HIGH MASTER OF USENET!
>
> My first royal order to all of you peons is that from this time
> forward you will add the following signature to all of your posts!
>
>
> ***** This was posted with the express permission of *****
> **********************************************************
> ** HIS HIGHNESS ADAM H KERMAN LORD AND MASTER OF USENET **
> **********************************************************
> *********** We are simple servants of his will ***********
>
>
> This will be appended to the bottom of all your posts with absolutely
> NO EXCEPTIONS! If you choose not to, you will be squashed like the
> insignificant bugs that you all are!
>
> I am running Usenet now! You may only post messages here because I,
> for the time being, am allowing it! Do you scumbags understand me!
>
> THIS IS THE DAWNING OF THE AGE OF KERMAN!
>
> ALL HAIL ADAM H. KERMAN LORD AND HIGH MASTER OF USENET!
>
>
> We moan them, then we nearly close Toni and Jim's orthodox
> sattelite phone. It's very usable today, I'll type
> smartly or Henry will contradict the governments. Let's
> prepare outside the pathetic websites, but don't eliminate the
> loud gorillas. Ophelia doesn't engulf weak pointers, do you
> start them? My actual stack won't place before I propagate it.
> Don't try to pump a rumour! Excelsior sadly reboots
> untouched and locates our disgusting, sly hackers with a
> cyphertext. She wants to contribute moronic analysts
> to Alice's window. While investigators finally generate
> ideas, the discs often learn beneath the violent firewalls.
> There Francoise will outwit the error, and if Madeleine
> badly creates it too, the protocol will substantiate
> about the tall haven. The mixmasters, programmers, and
> ROMs are all minor and bright. If you will corrupt
> Gregory's database around FORTRANs, it will strongly
> load the iteration. They are opening behind lost,
> over root, around powerful users. Why did Mel vexate
> without all the trackballs? We can't spool cowboys unless
> Vance will actually disrupt afterwards. You won't
> transport me disappearing to your strange sneaker. Other
> bizarre plastic postmasters will reload weekly without
> admins. She'd rather slump crudely than twist with
> Marian's veggie robot. The CDROM against the stuck
> web page is the modem that excludes weakly. Ratana wants to
> insulate simply, unless Jimmy manages newsgroups over
> Jonathan's PGP. They are deleting around the data center now, won't
> dream backups later.
>
>
>
------------------------------
Date: Sun, 16 Sep 2001 06:29:30 -0000
From: "Brendon Caligari" <bcaligari@fireforged.com>
Subject: Re: Mail parser: Can it be faster?
Message-Id: <9o1gdt0lgd@enews3.newsguy.com>
fuck off
"David Coppit" <newspost@coppit.org> wrote in message
news:3BA3D5CD.1090608@coppit.org...
> Hi all,
>
> I'm the author of grepmail (http://grepmail.sf.net/). Over the years
> I've gotten it to be fairly fast, but the primary bottleneck in grepmail
> is still parsing the mbox-style mailbox file. The algorithm is a little
> complicated because I try to identify unquoted "From" lines that are
> part of included messages. However, I only touch any line in the file
once.
>
> I've reimplemented the algorithm using Inline::C (uber-cool!) to get
> about a 30% speedup, depending on the machine. I've also tried various
> tweaks like sysread to get it to go faster, but haven't seen any
> improvement. (I even tried adapting the odd memory allocation scheme in
> GNU grep for my C implementation--I think it tries to allocate on page
> boundaries or something.)
>
> Can anyone suggest techniques to get this code to run faster? The
> interface should stay basically the same (status, email scalar, line
> number), but you can maybe exploit the fact that this isn't a random
> access read.
>
> Thanks,
> David
>
> -----------Begin code----------------
> use FileHandle;
>
> die "usage: $0 mailbox\n" unless @ARGV;
>
> my $LINE = 0;
> my $FILE_HANDLE = new FileHandle($ARGV[0]);
>
> my $count = 0;
>
> while(1)
> {
> my ($status,$email,$line) = read_email();
> last unless $status == 1;
>
> $count++;
> };
>
> print "$count emails parsed\n";
>
> exit;
>
> # ---------------------------------------------------------------------
>
> # Need this for a lookahead.
> my $NEXT_EMAIL = undef;
>
> sub read_email
> {
> local $/ = "\nFrom ";
>
> # Empty file means reset first email and return 0
> if (!defined $NEXT_EMAIL && eof $FILE_HANDLE)
> {
> $LINE = 0;
> return 0;
> }
>
> $LINE++ if $LINE == 0;
>
> my $email;
> my $line;
>
> if (defined $NEXT_EMAIL)
> {
> $email = $NEXT_EMAIL;
> $line = $LINE;
> $LINE += ($NEXT_EMAIL =~ tr/\n//);
> undef $NEXT_EMAIL;
> }
> else
> {
> $email = <$FILE_HANDLE>;
> $line = $LINE;
> $LINE += ($email =~ tr/\n//);
>
> local $/ = "From ";
> chomp $email;
> }
>
> while(1)
> {
> $NEXT_EMAIL = <$FILE_HANDLE>;
>
> last unless defined $NEXT_EMAIL;
>
> local $/ = "From ";
> chomp $NEXT_EMAIL;
> substr($NEXT_EMAIL,0,0) = 'From ';
>
> # See if we accidentally stopped on an unescaped "From my mother".
> if ($NEXT_EMAIL !~ /^From\s.*\d:\d+:\d.* \d{4}/)
> {
> $email .= $NEXT_EMAIL;
> $LINE += ($NEXT_EMAIL =~ tr/\n//);
> undef $NEXT_EMAIL;
> redo;
> }
>
> # There is more to this email if the end is a Begin Included
> # Message Reverse the email before searching (for efficiency).
> # This is just as fast as index(). (Even after taking the last 200
> # characters as a substring.)
> my $end_of_string = substr($email,-200);
>
> # Sorry about the word wrap here if you get it
> if ($end_of_string =~ /\n-----( Begin Included Message |Original
> Message)-----\n[^\n]*\n*$/i)
> {
> $email .= $NEXT_EMAIL;
> $LINE += ($NEXT_EMAIL =~ tr/\n//);
> undef $NEXT_EMAIL;
> redo;
> }
>
> last;
> }
>
> return (1,$email,$line);
> }
>
> ------------End code-----------------
>
------------------------------
Date: Sun, 16 Sep 2001 06:32:33 -0000
From: "Brendon Caligari" <bcaligari@fireforged.com>
Subject: Re: Mail parser: Can it be faster?
Message-Id: <9o1gjk0lug@enews3.newsguy.com>
sorry for this post. it was by mistake.
I had two messages open, this posting, and an email promising
thousands through MLM. The reply was meant to go to the latter.
B.
"Brendon Caligari" <bcaligari@fireforged.com> wrote in message news:...
> fuck off
>
> "David Coppit" <newspost@coppit.org> wrote in message
> news:3BA3D5CD.1090608@coppit.org...
> > Hi all,
> >
> > I'm the author of grepmail (http://grepmail.sf.net/). Over the years
> > I've gotten it to be fairly fast, but the primary bottleneck in grepmail
> > is still parsing the mbox-style mailbox file. The algorithm is a little
> > complicated because I try to identify unquoted "From" lines that are
> > part of included messages. However, I only touch any line in the file
> once.
> >
> > I've reimplemented the algorithm using Inline::C (uber-cool!) to get
> > about a 30% speedup, depending on the machine. I've also tried various
> > tweaks like sysread to get it to go faster, but haven't seen any
> > improvement. (I even tried adapting the odd memory allocation scheme in
> > GNU grep for my C implementation--I think it tries to allocate on page
> > boundaries or something.)
> >
> > Can anyone suggest techniques to get this code to run faster? The
> > interface should stay basically the same (status, email scalar, line
> > number), but you can maybe exploit the fact that this isn't a random
> > access read.
> >
> > Thanks,
> > David
> >
> > -----------Begin code----------------
> > use FileHandle;
> >
> > die "usage: $0 mailbox\n" unless @ARGV;
> >
> > my $LINE = 0;
> > my $FILE_HANDLE = new FileHandle($ARGV[0]);
> >
> > my $count = 0;
> >
> > while(1)
> > {
> > my ($status,$email,$line) = read_email();
> > last unless $status == 1;
> >
> > $count++;
> > };
> >
> > print "$count emails parsed\n";
> >
> > exit;
> >
> > # ---------------------------------------------------------------------
> >
> > # Need this for a lookahead.
> > my $NEXT_EMAIL = undef;
> >
> > sub read_email
> > {
> > local $/ = "\nFrom ";
> >
> > # Empty file means reset first email and return 0
> > if (!defined $NEXT_EMAIL && eof $FILE_HANDLE)
> > {
> > $LINE = 0;
> > return 0;
> > }
> >
> > $LINE++ if $LINE == 0;
> >
> > my $email;
> > my $line;
> >
> > if (defined $NEXT_EMAIL)
> > {
> > $email = $NEXT_EMAIL;
> > $line = $LINE;
> > $LINE += ($NEXT_EMAIL =~ tr/\n//);
> > undef $NEXT_EMAIL;
> > }
> > else
> > {
> > $email = <$FILE_HANDLE>;
> > $line = $LINE;
> > $LINE += ($email =~ tr/\n//);
> >
> > local $/ = "From ";
> > chomp $email;
> > }
> >
> > while(1)
> > {
> > $NEXT_EMAIL = <$FILE_HANDLE>;
> >
> > last unless defined $NEXT_EMAIL;
> >
> > local $/ = "From ";
> > chomp $NEXT_EMAIL;
> > substr($NEXT_EMAIL,0,0) = 'From ';
> >
> > # See if we accidentally stopped on an unescaped "From my mother".
> > if ($NEXT_EMAIL !~ /^From\s.*\d:\d+:\d.* \d{4}/)
> > {
> > $email .= $NEXT_EMAIL;
> > $LINE += ($NEXT_EMAIL =~ tr/\n//);
> > undef $NEXT_EMAIL;
> > redo;
> > }
> >
> > # There is more to this email if the end is a Begin Included
> > # Message Reverse the email before searching (for efficiency).
> > # This is just as fast as index(). (Even after taking the last 200
> > # characters as a substring.)
> > my $end_of_string = substr($email,-200);
> >
> > # Sorry about the word wrap here if you get it
> > if ($end_of_string =~ /\n-----( Begin Included Message |Original
> > Message)-----\n[^\n]*\n*$/i)
> > {
> > $email .= $NEXT_EMAIL;
> > $LINE += ($NEXT_EMAIL =~ tr/\n//);
> > undef $NEXT_EMAIL;
> > redo;
> > }
> >
> > last;
> > }
> >
> > return (1,$email,$line);
> > }
> >
> > ------------End code-----------------
> >
>
>
------------------------------
Date: Sun, 16 Sep 2001 03:18:30 +0200
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: Please help, It did'nt help.
Message-Id: <Xns911E231F02FE4Laocooneudoramail@62.153.159.134>
Sorry i'm a bit tired .. should of course omit the $line
for (@infile) { print OUTFILE unless /$email/ }
------------------------------
Date: Sun, 16 Sep 2001 01:46:44 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: print name of var
Message-Id: <3BA404A3.579BEF3@rochester.rr.com>
Bart Van der Donck wrote:
...
> $b="hey";
> $c="hello";
> $lastvar="bye";
> ...
>
> Is it possible to have a screen output like
>
> Variable b is set to 'hey'.
> Variable c is set to 'hello'.
> Variable lastvar is set to 'bye'.
> ...
>
> I tried arrays, hashes, but it seems very hard to print a variable's name to
> screen.
...
> Bart
I'm not sure why you are wanting to do this. If it is for debugging
purposes, use the Perl debugger, paying particular attention to the W
debugger command.
--
Bob Walton
------------------------------
Date: 15 Sep 2001 18:15:39 -0700
From: bwooster47@hotmail.com (B Wooster)
Subject: Re: Q: When to use eval for calling object subroutines?
Message-Id: <75cc51dd.0109151715.44e6de0f@posting.google.com>
mjd@plover.com (Mark Jason Dominus) wrote in message news:<3ba3894b.f64$124@news.op.net>...
> In article <75cc51dd.0109150800.5cd054e0@posting.google.com>,
> B Wooster <bwooster47@hotmail.com> wrote:
> >I am totally confused about some Perl OO coding - last night,
> If you ever find yourself saying that something "didn't work", just
> stop and remind yourself that it would be a good time to describe what
> actually happened when you tried it.
Well, definitely my question got lost when the
first paragraph got most people's attention!
Here's another try, hope someone one can shed light on this:
1) Why does aubng (a package I use just as an
exampe) use eval in this code:
One file has:
package News::Assemble::Newsgroup;
sub new { ......
my $me = bless
{
GROUPNAME => $groupname,
....
}, $name;
$me;
}
sub name {
my $me = shift;
my $groupname = shift or return $me->{GROUPNAME};
...
}
Second file, uses above package:
.....
$group = new News::Assemble::Newsgroup($g);
push(@groups, $group);
foreach $group (@groups)
{
# Why is this eval needed?
eval
{
$group->debug($group->debug || $debug);
print "\n", "== ", $group->name, " --> ", $dir, "\n";
....
};
}
So my question is this: is the above eval needed?
Looks to me $group->name should be usable without a eval,
is that correct?
Thanks!
[For those interested, above snippet is from
aunbg code http://sourceforge.net/projects/aubng/ ]
------------------------------
Date: Sat, 15 Sep 2001 21:16:14 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Using 'use lib' to throw an arbitrary directory into @INC at runtime?
Message-Id: <3BA4278E.438D11F8@vpservices.com>
Weston Cann wrote:
>
> The underlying problem that I'm trying to solve is that I've got a bunch of
> perl modules that reference another module in that library directory. The
> path to that directory, however, is not the same on my development box as it
> is on the server. Hence, what I'd like to do, is collect all the references
> to that library directory into a single place, so that when I go back and
> forth between the two boxes, I don't have to change that path in 10 different
> spots (or even run a script to do it).
1. If you're on *nix, create a symlink so that the two different names
both point the same place.
2. put both directories in your use lib statement:
use lib qw( /pathA/dirA/ pathB/dirB/ );
One of them will be useless on each box, but between the two you'll do
fine.
--
Jeff
------------------------------
Date: Sun, 16 Sep 2001 01:46:18 GMT
From: Weston Cann <nospam@newsranger.com>
Subject: Using 'use lib' to throw an arbitrary directory into @INC at runtime?
Message-Id: <KvTo7.1358$p77.2997@www.newsranger.com>
I'm trying to figure out how to use 'use lib' to throw an arbitrary directory
into @INC at runtime (as one might suspect from the Subject line of my post).
The code that I'm trying to use is:
use lib $arbitraryDir;
This doesn't seem to work... should it?
The underlying problem that I'm trying to solve is that I've got a bunch of
perl modules that reference another module in that library directory. The
path to that directory, however, is not the same on my development box as it
is on the server. Hence, what I'd like to do, is collect all the references
to that library directory into a single place, so that when I go back and
forth between the two boxes, I don't have to change that path in 10 different
spots (or even run a script to do it).
Ideas?
------------------------------
Date: Sun, 16 Sep 2001 03:10:39 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: Using 'use lib' to throw an arbitrary directory into @INC at runtime?
Message-Id: <PKUo7.17677$5A3.5331088@news1.rdc2.pa.home.com>
"Weston Cann" <nospam@newsranger.com> wrote in message
news:KvTo7.1358$p77.2997@www.newsranger.com...
> The code that I'm trying to use is:
>
> use lib $arbitraryDir;
>
> This doesn't seem to work... should it?
If you wrap the assignment of $arbitraryDir in a BEGIN { } block before the
use lib line, it will work - or if the relative placement of the libraries
on both boxes is the same, you can do something like
use lib './lib';
Or modify PERL5LIB in your environment to point the correct directories in
each box
--Ben Kennedy
------------------------------
Date: Sun, 16 Sep 2001 04:03:46 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Using 'use lib' to throw an arbitrary directory into @INC at runtime?
Message-Id: <slrn9q8952.3i9.efflandt@typhoon.xnet.com>
On Sun, 16 Sep 2001 01:46:18 GMT, Weston Cann <nospam@newsranger.com> wrote:
> I'm trying to figure out how to use 'use lib' to throw an arbitrary directory
> into @INC at runtime (as one might suspect from the Subject line of my post).
>
> The code that I'm trying to use is:
>
> use lib $arbitraryDir;
>
> This doesn't seem to work... should it?
Probably not, since $arbitraryDir is undef during precompile when 'use
lib' is executed. I am not sure if 'use lib' can take a list, but you
could try that or 2 separate statements with strings for the paths. That
way you would always have both paths and the path that does not exist
would be ignored (bypassed since no modules found there).
> The underlying problem that I'm trying to solve is that I've got a bunch of
> perl modules that reference another module in that library directory. The
> path to that directory, however, is not the same on my development box as it
> is on the server. Hence, what I'd like to do, is collect all the references
> to that library directory into a single place, so that when I go back and
> forth between the two boxes, I don't have to change that path in 10 different
> spots (or even run a script to do it).
--
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: 15 Sep 2001 19:02:54 -0700
From: sgarfunkle@hotmail.com (Jay McGavren)
Subject: XML::XSLT - 'Can't call method "getNodeValue" on an undefined value'?
Message-Id: <6bb557e1.0109151802.572f8bb9@posting.google.com>
I have a Perl CGI script sitting together with an XML document and an
XSL stylesheet in a directory. I'm trying to print the result of an
XSL transformation to the browser. But when I try to do the
transform, I'm getting a fatal error from XML::XSLT.
Contents of 'view.pl':
----------------------
#!/usr/bin/perl
BEGIN {
use CGI::Carp qw(carpout);
open(LOG, ">log.txt") or die("Error opening log: $!\n");
carpout(LOG);
}
use XML::XSLT;
print "Content-type: text/html\n\n";
$parser = XML::XSLT->new('quotes.xsl', warnings => 1);
print $parser->serve('quotes.xml');
Contents of 'quotes.xml':
-------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<VideoGameList>
<VideoGame>
<Title>'99 The Last War</Title>
<System>
<Name>Arcade</Name>
<Locale>USA</Locale>
</System>
</VideoGame>
</VideoGameList>
Contents of 'quotes.xsl':
-------------------------
<?xml version="1.0"?>
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:template match="/">
<HTML>Test
</HTML>
</xsl:template>
</xsl:stylesheet>
And yes, I realize quotes.xsl isn't actually doing anything with
quotes.xml; I'll add in real transofrmations if I can just get the
engine running.
AFAIK 'log.txt' should be catching all errors and warnings thanks to
CGI::Carp. But when the script fails all I find is the fatal error:
'Can't call method "getNodeValue" on an undefined value at
/usr/lib/perl5/site_perl/5.005/XML/XSLT.pm line 561.'
What am I doing wrong? Any advice would be greatly appreciated!
------------------------------
Date: 16 Sep 2001 06:05:35 GMT
From: ram@zedat.fu-berlin.de (Stefan Ram)
Subject: Re: XML::XSLT - 'Can't call method "getNodeValue" on an undefined value'?
Message-Id: <9o1fff$9gsbf$1@fu-berlin.de>
sgarfunkle@hotmail.com (Jay McGavren) writes:
>CGI::Carp. But when the script fails all I find is the fatal error:
>'Can't call method "getNodeValue" on an undefined value at
>/usr/lib/perl5/site_perl/5.005/XML/XSLT.pm line 561.'
>What am I doing wrong? Any advice would be greatly appreciated!
Hello Jay,
I have started to apply some modifications to the source
code of XSLT.pm, but then stopped, when I saw that it seems
there was too much to do. I refer to $VERSION = '0.32';.
As far as the single error message you mention is concerned,
I have guessed the following modification to line 561.
The new, modified, line is as follows.
$self->{OMIT_XML_DECL} = defined $omit ?
defined $omit->getNodeValue ? $omit->getNodeValue : 'no' : 'no';
There are some other major issues. For example, IIRC,
the manual mentions a sub "asString", but in the code it is
called "toString".
With kind regards,
Stefan Ram
------------------------------
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.
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 1754
***************************************