[26818] in Perl-Users-Digest
Perl-Users Digest, Issue: 8852 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 15 03:05:44 2006
Date: Sun, 15 Jan 2006 00:05:06 -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 Sun, 15 Jan 2006 Volume: 10 Number: 8852
Today's topics:
Re: Easier web programming language: PERL or PHP? <tadmc@augustmail.com>
Re: Easier web programming language: PERL or PHP? <jmichae3@yahoo.com>
Re: ExpatXS: 'Can't call method "read" on an undefined <matthew.garrish@sympatico.ca>
File-Find skips directories with spaces depending on pa <matthew.garrish@sympatico.ca>
Re: mechanize follow_link () on an image <nospam@home.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 14 Jan 2006 15:27:14 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Easier web programming language: PERL or PHP?
Message-Id: <slrndsir5i.2l4.tadmc@magna.augustmail.com>
Jim Michaels <jmichae3@yahoo.com> wrote:
> I know this is a PERL group,
Then you know incorrectly.
This is a Perl group.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 14 Jan 2006 22:19:11 -0800
From: "Jim Michaels" <jmichae3@yahoo.com>
Subject: Re: Easier web programming language: PERL or PHP?
Message-Id: <uaOdnSrBjOXjdFTenZ2dnUVZ_tadnZ2d@comcast.com>
I stand corrected. it's been a while. I just looked at the official Perl
book's title. I used to write all my GUIs in Tcl/TK (still do), system
utilities in C++ and Perl. But I'm no longer maintaining a server.
Actually, I did write a GUI in Perl because it had Tk available (a bit more
cumbersome under Perl than Tcl).
If you do try Tk, I suggest having a Tcl/Tk book handy as a reference on the
widgets and how they work, as the documentation that comes with the Perl
module isn't sufficient. And you'll need lots of time experimenting if
you're using a newer widget like heirarchy (the name was something like
that).
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrndsir5i.2l4.tadmc@magna.augustmail.com...
> Jim Michaels <jmichae3@yahoo.com> wrote:
>
>> I know this is a PERL group,
>
>
> Then you know incorrectly.
>
> This is a Perl group.
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Sat, 14 Jan 2006 19:24:27 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: ExpatXS: 'Can't call method "read" on an undefined value' after ca. 500 XML files
Message-Id: <ZCgyf.1600$La2.95653@news20.bellglobal.com>
"Arvin Portlock" <nomail@sorry.com> wrote in message
news:dq9gb7$219p$1@agate.berkeley.edu...
> In using ExpatXS to parse large batches of XML files
> something curious happens. After parsing something close
> to 500 files the program crashes with the error:
>
> Can't call method "read" on an undefined value at
> /xxx/perl5.8/lib/site_perl/5.8.7/sun4-solaris-thread-multi/
> XML/SAX/ExpatXS.pm line 155.
>
You aren't checking whether you succesfully get an object. I would doubt
it's a memory leak or your system would have ground to a halt. I don't see
where you're trying to call a read method anywhere in your code, but I would
suggest wrapping the objects in an eval and see if that gives you more info.
At the very least it should isolate which module is causing the problem:
my ($filter, $parser);
eval { $filter = new XML::Filter::BufferText (Handler => $handler); };
if ($@) {
die "Couldn't get a new Buffer Object: $@\n";
}
eval { $parser = XML::SAX::ParserFactory->parser(Handler => $filter); };
if ($@) {
die "Couldn't get a new ParserFactory Object: $@\n";
}
Matt
------------------------------
Date: Sat, 14 Jan 2006 20:20:04 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: File-Find skips directories with spaces depending on path separator on Windows
Message-Id: <6rhyf.1637$La2.98301@news20.bellglobal.com>
After making a rather juvenile over-simplification in a previous thread, I
wrote a script out of pure curiosity to see how many extensionless files I
could find on my c:\ drive. I wrote the following simple code to do this:
### code start
use File::Find;
my ($ext, $noext);
find(\&wanted, 'c:/');
print "Files with extensions: $ext\nFiles without extensions: $noext\n";
sub wanted {
return if -d $File::Find::name;
($File::Find::name =~ /\.\w+$/) ? $ext += 1 : $noext += 1;
}
### code end
Which gave me the following obviously inaccurate results:
Files with extensions: 4811
Files without extensions: 236
I printed the filenames as it went and noticed quickly that it was skipping
all directories with spaces in the path (\program files\, etc.). I then
changed the invokation to the following:
find(\&wanted, 'c:\\');
And instead got the following
Files with extensions: 66954
Files without extensions: 1522
Is this a bug in File::Find? Or am I making an incorrect assumption about
how it works?
Matt
------------------------------
Date: Sun, 15 Jan 2006 05:24:17 GMT
From: "Nospam" <nospam@home.com>
Subject: Re: mechanize follow_link () on an image
Message-Id: <50lyf.43996$zt1.40641@newsfe5-gui.ntli.net>
"Mark Clements" <mark.clementsREMOVETHIS@wanadoo.fr> wrote in message
news:43c9823f$0$20171$8fcfb975@news.wanadoo.fr...
> Nospam wrote:
> > tried your suggestions, none of them work unfortunately
> >
> > I am wondering if i used $mech->find_link( tag_regex=>"newtopic.gif");
> >
> > then followed the contents:
> > my $regex2 = find_link( tag_regex=>"newtopic.gif");
> >
> > follow_link($regex2);
> >
> > if it would make any difference?
> >
> >
>
> try this:
>
> use strict;
> use warnings;
>
> use Data::Dumper;
> use WWW::Mechanize;
>
> use constant START => "http://www.warservers.com/f/viewtopic~t~19029.htm";
>
> my $mech = WWW::Mechanize->new();
>
> $mech->get( START );
> print $mech->uri."\n";
> $mech->follow_link( url_regex => qr(posting~mode~reply));
> print $mech->uri."\n";
thanks the print out follows the link
I am wondering if I had a series of urls in a text file (c:\text1.txt"), how
I would amend use constant START so it goes through each url in the text
file
------------------------------
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 8852
***************************************