[23935] in Perl-Users-Digest
Perl-Users Digest, Issue: 6136 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 15 14:05:52 2004
Date: Sun, 15 Feb 2004 11: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 Feb 2004 Volume: 10 Number: 6136
Today's topics:
Re: $ENV{'URL'} <raisin@delete-this-trash.mts.net>
Re: Choosing grouping of split items (Anno Siegel)
Re: Choosing grouping of split items (Jay Tilton)
Re: Choosing grouping of split items <uri@stemsystems.com>
Re: compile Perl as a STATIC library <tmohr@s.netic.de>
Re: compile Perl as a STATIC library <tmohr@s.netic.de>
configure problem <alan@asandco.co.uk>
Re: configure problem <tony_curtis32@_SPAMTRAP_yahoo.com>
Re: configure problem <alan@asandco.co.uk>
Re: configure, WIN32 <tmohr@s.netic.de>
Re: configure, WIN32 <usenet@morrow.me.uk>
Re: Environment question <none@none.com>
Re: Environment question <none@none.com>
Re: Environment question <none@none.com>
Re: Environment question <noreply@gunnar.cc>
Re: Environment question <uri@stemsystems.com>
Re: Environment question <groups@donstefani.com>
Re: open pipe vs signals causing problems ? (funtoosh)
Re: Replacing unicode characters <bart.lateur@pandora.be>
Re: Understanding 'scope' thumb_42@yahoo.com
using HTML::Template <garoses@scn.org>
Re: using HTML::Template <ceo@nospan.on.net>
Re: Why is Perl losing ground? <bart.lateur@pandora.be>
Re: XML::Parser Style => Object thumb_42@yahoo.com
Re: XML::Parser Style => Object <usenet@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 15 Feb 2004 08:18:56 -0600
From: Web Surfer <raisin@delete-this-trash.mts.net>
Subject: Re: $ENV{'URL'}
Message-Id: <MPG.1a993bc8360d7aa09897b3@news.mts.net>
In article <40286147.DAAB68FD@asgweb.net>, todd@asgweb.net says...
> Hello,
> $ENV{'SERVER_NAME'} this indentifies a server name
> $ENV{'SCRIPT_NAME'} this indentifies a script name
> does anyone know what code would be used to indentify the url used to
> access a site?
> Thanks in advance for your help.
First, I believe that a group dedicated to writing CGI scripts, such as
comp.infosystems.www.authoring.cgi , would be a better place for
questions such as this.
But I believe that the variable in question would be
$ENV{'HTTP_REFERER'}
------------------------------
Date: 15 Feb 2004 11:30:58 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Choosing grouping of split items
Message-Id: <c0nl9i$l23$2@mamenchi.zrz.TU-Berlin.DE>
fishfry <BLOCKSPAMfishfry@your-mailbox.com> wrote in comp.lang.perl.misc:
> If I have
>
> $text = 'abc - def - ghi - jkl";
>
> then
>
> @tokens = split(/-/, $text, 3);
>
> splits the line into abc, def, ghi - jkl (ignoring leading and trailing
> spaces).
>
> I have an application where there may be 3 or 4 items separated by '-'
> but if there are 4, I want them returned as abc - def, ghi, and jkl.
>
> Is there a one-liner for that?
You can force almost everything into a single statement, the question is
if you want to. Here is one way:
my @tokens = reverse map scalar reverse, split /-/, reverse( $str), 3;
How long does it take to find out what this does? And how long for a
plain two-statement procedure?
my @tokens = split /-/, $str;
@tokens = ( "$tokens[ 0]-$tokens[ 1]", @tokens[ 2 .. $#tokens]) if
@tokens > 3;
Anno
------------------------------
Date: Sun, 15 Feb 2004 11:57:04 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Choosing grouping of split items
Message-Id: <402f57cc.289705282@news.erols.com>
fishfry <BLOCKSPAMfishfry@your-mailbox.com> wrote:
: If I have
:
: $text = 'abc - def - ghi - jkl";
:
: then
:
: @tokens = split(/-/, $text, 3);
:
: splits the line into abc, def, ghi - jkl (ignoring leading and trailing
: spaces).
:
: I have an application where there may be 3 or 4 items separated by '-'
: but if there are 4, I want them returned as abc - def, ghi, and jkl.
What did you try?
Split the string and rejoin whatever fields you want to be together.
my @tokens = split /-/, $text;
unshift @tokens, join '-', splice @tokens,0,-2;
: Is there a one-liner for that?
If that's what really turns you on.
my @tokens = map scalar reverse, reverse split(/-/, reverse($text), 3);
Yuck. Stick with the two-liner.
Odd. I don't see anywhere in the documentation that says scalar reverse()
defaults to acting on $_ when no argument is supplied, but it evidently
does.
------------------------------
Date: Sun, 15 Feb 2004 17:31:13 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Choosing grouping of split items
Message-Id: <x7lln48d26.fsf@mail.sysarch.com>
>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
AS> my @tokens = split /-/, $str;
AS> @tokens = ( "$tokens[ 0]-$tokens[ 1]", @tokens[ 2 .. $#tokens]) if
AS> @tokens > 3;
blech!
$tokens[0] .= '-' . splice( @tokens, 1, 1 ) if @tokens > 3;
or
splice( @tokens, 0, 2 ) = join '-', splice( @tokens, 1, 1 )
if @tokens > 3;
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sun, 15 Feb 2004 17:15:17 +0100
From: Torsten Mohr <tmohr@s.netic.de>
Subject: Re: compile Perl as a STATIC library
Message-Id: <c0o5ul$708$2@schleim.qwe.de>
Hi,
> If they're perl scripts, then use PAR to build them into executables and
> distribute those executables with the perl58.dll. (No need to distribute
> the modules as well.)
That's the point, i don't want to ship an external perl58.dll, i
want it as a static lib.
On Linux i have a "libperl.a", why isn't this possible on Win32?
Best regards,
Torsten.
------------------------------
Date: Sun, 15 Feb 2004 17:18:31 +0100
From: Torsten Mohr <tmohr@s.netic.de>
Subject: Re: compile Perl as a STATIC library
Message-Id: <c0o64n$708$3@schleim.qwe.de>
Hi,
> Get MinGW (http://www.mingw.org) and build it properly with Configure
> and make: it's a supported configuration on win32. (NB this is not the
> same as cygwin: the final perl.exe doesn't depend on any special dlls
> or POSIX emulation layers, only on MSVCRT.dll as ever.)
Thanks for that hint. I tried it, but:
"Configure -d -Uusedl" starts fine, asks for the C library, continues
and at some point doesn't find some functions and then doesn't write
a Makefile. No way to continue...
What could be the problem? I don't remember the names of the missing
functions right now, i'll post them when i'm on that Win32 PC again.
On Linux i have libperl.a, shouldn't this be possible on Win32?
Thanks for hints,
Torsten.
------------------------------
Date: Sun, 15 Feb 2004 17:03:56 +0000
From: Alan secker <alan@asandco.co.uk>
Subject: configure problem
Message-Id: <c0o8ob$rgh$1@news.freedom2surf.net>
I am trying to install per 5.8.3 on a Linux Mandrake 9.2 system and
failing at the confiuration stage. It seems that regardless of the
options that I select, I end up with the following:
The command the script builds to run a test file is:
gcc -0 try try.c -lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil -lc ./try
The output:
/usr/lib/libndbm.so undefined reference to 'errno'
collect2: ld returned 1 exit status
Can anyone put me sraight?
TIA
Alan
------------------------------
Date: Sun, 15 Feb 2004 11:09:22 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: configure problem
Message-Id: <874qtsz2v1.fsf@limey.hpcc.uh.edu>
>> On Sun, 15 Feb 2004 17:03:56 +0000,
>> Alan secker <alan@asandco.co.uk> said:
> I am trying to install per 5.8.3 on a Linux Mandrake 9.2
> system and failing at the confiuration stage. It seems that
> regardless of the options that I select, I end up with the
> following:
> The command the script builds to run a test file is:
> gcc -0 try try.c -lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil
> -lc ./try
Are you *sure* that's exactly the attempted command?
Cut-n-paste it, don't try to copy by hand.
OTOH if that *is* the real command, something else is
seriously messed up.
------------------------------
Date: Sun, 15 Feb 2004 18:54:04 +0000
From: Alan secker <alan@asandco.co.uk>
Subject: Re: configure problem
Message-Id: <c0of6q$tnf$1@news.freedom2surf.net>
Tony Curtis wrote:
>>>On Sun, 15 Feb 2004 17:03:56 +0000,
>>>Alan secker <alan@asandco.co.uk> said:
>
>
>>I am trying to install per 5.8.3 on a Linux Mandrake 9.2
>>system and failing at the confiuration stage. It seems that
>>regardless of the options that I select, I end up with the
>>following:
>
>
>>The command the script builds to run a test file is:
>
>
>>gcc -0 try try.c -lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil
>>-lc ./try
>
>
> Are you *sure* that's exactly the attempted command?
>
> Cut-n-paste it, don't try to copy by hand.
>
> OTOH if that *is* the real command, something else is
> seriously messed up.
Tony
This is the cut 'n paste as generated at the end of configure:
<START>
I used the command:
gcc -o try -O3 -fno-strict-aliasing -I/usr/local/include
-L/usr/local/lib try.c -lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil -lc
./try
and I got the following output:
/usr/lib/libndbm.so: undefined reference to `errno'
collect2: ld returned 1 exit status
I can't compile the test program.
(The supplied flags or libraries might be incorrect.)
<END>
Alan
------------------------------
Date: Sun, 15 Feb 2004 17:12:57 +0100
From: Torsten Mohr <tmohr@s.netic.de>
Subject: Re: configure, WIN32
Message-Id: <c0o5q9$708$1@schleim.qwe.de>
>> Is there a way to pass some more parameters to "configure"
>> on WIN32?
>>
>> Do i need to use MinGW then?
>>
>
> Have you ruled out Cygwin for this ? Strikes me that it's probably your
> best chance of success. See 'README.cygwin' in the perl source distro.
>
> If you're committed to native Win32, and thinking of starting with
> './configure', then look at using the Mingw compiler in an MSYS shell -
> but I don't fancy your chances with this approach.
>
Thanks for that hint, but it didn't really bring me any further.
"Configure -d -Uusedl" starts fine, asks for the C library, continues
and at some point doesn't find some functions and then doesn't write
a Makefile. No way to continue...
Any other ideas?
I'd like pure native Win32, but i at least tried cygwin. Configure
stops quite early there.
Best regards,
Torsten.
------------------------------
Date: Sun, 15 Feb 2004 17:47:00 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: configure, WIN32
Message-Id: <c0obak$9l2$1@wisteria.csv.warwick.ac.uk>
Torsten Mohr <tmohr@s.netic.de> wrote:
> >> Is there a way to pass some more parameters to "configure"
> >> on WIN32?
> >>
> >> Do i need to use MinGW then?
> >
> > Have you ruled out Cygwin for this ? Strikes me that it's probably your
> > best chance of success. See 'README.cygwin' in the perl source distro.
> >
> > If you're committed to native Win32, and thinking of starting with
> > './configure', then look at using the Mingw compiler in an MSYS shell -
> > but I don't fancy your chances with this approach.
>
> Thanks for that hint, but it didn't really bring me any further.
> "Configure -d -Uusedl" starts fine, asks for the C library, continues
> and at some point doesn't find some functions and then doesn't write
> a Makefile. No way to continue...
>
> Any other ideas?
README.win32 (you *have* read it?) says you need to use dmake and the
makefile in win32/. Looking at it, you should (maybe) be able to get a
static build by unpacking the extensions you need under ext/ and then
changing the definition of STATIC_EXT in makefile.mk to include them
all. DYNAMIC_EXT should be empty.
NB: I've no idea if this will work.... :)
Ben
--
The cosmos, at best, is like a rubbish heap scattered at random.
- Heraclitus
ben@morrow.me.uk
------------------------------
Date: Sun, 15 Feb 2004 08:25:23 -0600
From: "Bill Staples" <none@none.com>
Subject: Re: Environment question
Message-Id: <pan.2004.02.15.14.25.22.115845@none.com>
>
> no include statement? where did you learn perl? perl has at least 3
> include-like operations and eval which means you can roll your own as
> well. and do you think all the massive amounts of perl code written is
> only in large files? and what about cpan?
>
> please be learning more perl before making wrong statements like this.
>
> uri
I didn't say I "learned' perl. I just said I was using it and I still
think I am right about the fact that perl has no include statement. Maybe
I should have said that perl apparently has no "include" statement to make
it specific.
And I thought that by asking the question that I was "...be learning more
perl..." just like you said.
Thank you for your information.
Bill
------------------------------
Date: Sun, 15 Feb 2004 08:28:29 -0600
From: "Bill Staples" <none@none.com>
Subject: Re: Environment question
Message-Id: <pan.2004.02.15.14.28.25.831517@none.com>
> There have been some silly people posting from none@none.com here in the
> past. Are you willing to take on the reputation that they have built as
> your own reputation?
>
> More people will see your articles if you use some other (ie. proper)
> form of address munging...
>
Thanks, but my newsreader chose none@none for me and I never thought about
it before. I figure that my admittedly newbie (perlwise) posts will have
to stand on their own.
Bill
------------------------------
Date: Sun, 15 Feb 2004 08:35:52 -0600
From: "Bill Staples" <none@none.com>
Subject: Re: Environment question
Message-Id: <pan.2004.02.15.14.35.50.847717@none.com>
> I think you must mean "called programs", as "modules" appears
> to be exactly the thing that you are looking for below.
Yeah, I should have said "called scripts" but I am so used to thinking
"module" that it just slipped out.
>
> perldoc -f use (nice)
> perldoc -f require (crufty)
>
> perldoc perlmod
> perldoc perlmodlib
> perldoc perlmodinstall
> perldoc perlmodstyle
I will give them a looksee. Other than the system docs, my total Perl
reference library consists of one Oreilly book. Not a whole lot of tech
libraries and book stores out here in the Texas piney woods and I don't
get to any cities with pavement very often.
Thanks.
Bill
------------------------------
Date: Sun, 15 Feb 2004 16:57:24 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Environment question
Message-Id: <c0o51u$16c2st$1@ID-184292.news.uni-berlin.de>
Bill Staples wrote:
> Uri Guttman wrote:
>> please be learning more perl before making wrong statements like
>> this.
>
> I didn't say I "learned' perl. I just said I was using it and I
> still think I am right about the fact that perl has no include
> statement.
What are you talking about?? You said exactly: "Perl apparently
doesn't have an include statment or equivilent". That is an incorrect
statement, which both Tad and Uri pointed out.
> And I thought that by asking the question that I was "...be
> learning more perl..." just like you said.
The "question" you asked was presumptuous, and a bad starting-point
when asking others for help. Still you got some useful hints.
> Thank you for your information.
How about studying that information so you realize that you were wrong?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 15 Feb 2004 17:26:05 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Environment question
Message-Id: <x7oes08dar.fsf@mail.sysarch.com>
>>>>> "BS" == Bill Staples <none@none.com> writes:
BS> I will give them a looksee. Other than the system docs, my total Perl
BS> reference library consists of one Oreilly book. Not a whole lot of tech
BS> libraries and book stores out here in the Texas piney woods and I don't
BS> get to any cities with pavement very often.
ever heard of the web? or amazon or barnes & noble? how about
book.perl.org? did you INCLUDE them in your search for perl resources?
and your claim about perl not having an include statement was refuted
and you still haven't acknowledged that.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sun, 15 Feb 2004 17:41:28 GMT
From: Don Stefani <groups@donstefani.com>
Subject: Re: Environment question
Message-Id: <cbOXb.25622$UI4.23305@newssvr25.news.prodigy.com>
Bill Staples wrote:
Not a whole lot of tech
> libraries and book stores out here in the Texas piney woods and I don't
> get to any cities with pavement very often.
Ted Nugent does some side work for FedEx, he can find you! ;-)
http://www.bookpool.com/.x/z8dxy9hoa6/ss/1?qs=perl&Go.x=0&Go.y=0&Go=Go
Have ActiveState Perl installed on windows close by?
C:\Perl\html\index.html
I doesn't get much more organized than this.
For a real Rock 'n' Roll High School...
http://www.bookpool.com/.x/z8dxy9ks4m/sm/0596006225
I haven't baought a book from a bookstore in...? I can't remember.
Oh man, when was the last time I left my house..? I can't remember.
------------------------------
Date: 15 Feb 2004 05:59:34 -0800
From: a_gilotra@yahoo.com (funtoosh)
Subject: Re: open pipe vs signals causing problems ?
Message-Id: <5fe73253.0402150559.6e190f47@posting.google.com>
Yes. Its my fault. I shd. have provided more information abt the
environment.
I am using v5.6.1 of Perl on i386 linux. Kernel 2.4.20-20.9 from
Redhat
libc-2.2.5.so is installed on my system.
So, when u run this script, it catches the signal and also kills
anotherProgram too ?
Brian McCauley <nobull@mail.com> wrote in message news:<u9hdxukefn.fsf@wcl-l.bham.ac.uk>...
> a_gilotra@yahoo.com (funtoosh) writes:
>
> > I am using latest PERL
>
> It's Perl not PERL.
>
> > provided with REDHAT 9.
>
> Perhaps it would help those of us who use SuSE or a different version
> of RedHat even some other *nix is you were to say what version of Perl
> that is since this is marginally more likely to be a Perl issue than
> an OS issue.
>
> At least show us the first line form "perl -v" and maybe even selected
> highlights of "perl -V" if you suspect this could be platform-related
> (and that wouldn't be a ureasonable supposition),
>
> > I use this snippet of perl in t.pl
> >
> > $SIG{'TERM'}=\&doItNow ;
> > $anotherProgram=$ARGV[0];
> >
> > open (AP,"$anotherProgram |") or die "$_ \n" ;
> >
> > sub doItNow {
> > print "called doItNow \n ";
> > }
>
> > perl t.pl "../working/nameoftheprogram" &
>
> > Now, when I send signal SIGTERM to the perl script, it DOES NOT call
> > the installed handler
>
> Your test script works OK for me on 5.6.1 and 5.8.0 on SuSE Linux
> (albeit with an old glibc).
>
> The newsgroup comp.lang.perl does not exist (see FAQ). Please do not
> start threads there.
------------------------------
Date: Sun, 15 Feb 2004 11:28:42 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Replacing unicode characters
Message-Id: <dnlu2090j3956mko6tsafjiclv5gf3u2i5@4ax.com>
Tulan W. Hu wrote:
>I tried the above and got the following error message
>"\x{2019}" does not map to iso-8859-1 at utf.pl line 8, <$FILE> line 161.
>but the pre-5.8 code just removes the characters for me.
Don't use Latin-1 for the encoding, try cp1252 (AKA Windows) instead.
That turns out to be chr(0x92) ("right single quotation mark"). For the
whole list, see
<http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT>
If you don't want the Windows character set, I'd replace all "single
quotation marks" with apostrophes, ("'", chr(39)), and all "double
quotation marks" with quotes ('"', chr(34)).
--
Bart.
------------------------------
Date: Sun, 15 Feb 2004 16:00:29 GMT
From: thumb_42@yahoo.com
Subject: Re: Understanding 'scope'
Message-Id: <xIMXb.323246$na.476454@attbi_s04>
Prabh <Prab_kar@hotmail.com> wrote:
> Hello all,
> Is it possible to access a variable with local scope in a subroutine
> from outside of the subroutine?
Yes. Old perl code uses local variables, strict won't like it, and you'll
probably get warnings.
###########################################
$wacky = "Package global";
print "wacky == $wacky\n";
&top_level();
print "wacky == $wacky\n";
sub top_level {
local($wacky); # Variable is now "local" that is, the previous
# data is "pushed" on a stack, during the duration
# of this scope, $wacky will contain the value:
# "Don't do this it's bad"
#
# You'll be able to access $wacky from any sub called
# from here, and on through subs called by those subs, but
# not from the callers scope.
#
# Lots of people will point out that the use of local()
# is generally considered a very bad idea, you can safely
# ignore these people. they are probably the kind of
# people who don't enjoy the taste of licking very cold
# steel either :-)
$wacky = "Don't do this it's bad";
&some_sub();
}
sub some_sub {
print "Value of wacky: $wacky\n";
}
>
> e.g.,
>
> #usr/local/bin/perl
>
> use strict ;
> use warnings ;
>
> sub testScope
> {
> my $var = 10 ;
> }
>
> &testScope ;
> print "$var\n" ;
>
> ==========================================
>
> It doesnt compile with 'use strict', after removing strict, I get
> blank from the print.
>
> Is it possible to retrieve $var in some 'testScope::$var' fashion?
> I realize I could add "return $var;" to the subroutine and access it
> from the out, but was just curious if its possible to access
> variables.
>
> If I dont use "my" or "strict" I can.
> If its a frowned-upon practice, then why does Perl allow it in the
> first place?
>
> Thanks for your time,
> Prab
------------------------------
Date: Sun, 15 Feb 2004 16:58:35 GMT
From: "Aeden Jameson" <garoses@scn.org>
Subject: using HTML::Template
Message-Id: <210425bb85180706f20e16711f459817@news.teranews.com>
When you create an HTML::Template object under apache/mod-perl 2 I have to
specify the absolute path of the html template file. What do I need to do
to use relative paths? Are there any drawbacks to such use?
Currently when I use relative paths I get an error message in the apache log
that the file cannot be found.
Cheers,
Aeden Jameson
------------------------------
Date: Sun, 15 Feb 2004 18:34:46 GMT
From: Chris <ceo@nospan.on.net>
Subject: Re: using HTML::Template
Message-Id: <aZOXb.10612$pf7.3989@newssvr31.news.prodigy.com>
Aeden Jameson wrote:
> When you create an HTML::Template object under apache/mod-perl 2 I have to
> specify the absolute path of the html template file. What do I need to do
> to use relative paths? Are there any drawbacks to such use?
> Currently when I use relative paths I get an error message in the apache log
> that the file cannot be found.
>
So are you saying that...
my $tmpl = HTML::Template->new(
filename => 'sample.tmpl',
path => [
'/path/to/templates',
'/other/path/to/templates',
]
);
doesn't work under mod_perl, specifically the 'path' named anonymous
array argument?
Chris
-----
Chris Olive
chris -at- --_____--_____-- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")
------------------------------
Date: Sun, 15 Feb 2004 11:23:02 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Why is Perl losing ground?
Message-Id: <19lu20hccgbhcs4qngakbg6r5jk05dltvo@4ax.com>
Ben Morrow wrote:
>OK, yes, there's one *hell* of a lot of really badly written Perl out
>there. Perl is a tool which treats the programmer as a responsible
>adult, capable of making sensible decisions about the compromise
>between readability and brevity, between getting the thing working now
>and keeping it working later. All too many programmers abuse that
>responsibility, but that doesn't make Perl a bad language, it makes
>tham bad programmers.
Which reminds me... The motto for Perl is TIMTOWTDI, there's more than
one road to Rome, which some people think is a bad thing, because other
languages enforce the One True Way to do something. So Perl gives you
the freedom, while the other languages don't. *shrug*
But where this really begins to matter, is when trying to do something
the language was *not * designed for. In Perl, because of the freedom,
there will most likely turn out to be an acceptable way to write it --
even though with fewer choices available than for the more common
problems. But those other languages simply won't allow you to write the
code. Period.
Sorry, I can't think of a proper example right now. Heh, think of this
as an purely abstract and unproven idea, then.
--
Bart.
------------------------------
Date: Sun, 15 Feb 2004 15:34:00 GMT
From: thumb_42@yahoo.com
Subject: Re: XML::Parser Style => Object
Message-Id: <IjMXb.318285$xy6.1543003@attbi_s02>
In comp.lang.perl.misc Michel Rodriguez <mirod@xmltwig.com> wrote:
> Is there any specific reason why you chose to use XML::Parser?
> XML::Parser is really a low level module, that IMHO should not be used
> directly.
Of the XML solutions out there that I've seen, (mostly java ones) I still
find XML::Parser (in event mode) the easiest/fastest. (I haven't messed with
that many perl modules for XML though)
Takes a little bit to get used to at first, since the documentation
introduces it as some sort of tree that is rather difficult to grok, but if
you skip passed that and get to the event model, it's easy to process XML.
(seems pretty fast too). Only difficult thing of XML::Parser I've ever been
mixed up with was dealing with name spaces.
I've done some pretty wild stuff with XML::Parser, and can say that it's
enjoyable. :-)
I'd almost rather build my own custom tree than to deal with any DOM level
stuff. (unless I were writing XML)
Jamie
------------------------------
Date: Sun, 15 Feb 2004 15:57:00 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: XML::Parser Style => Object
Message-Id: <c0o4sc$77e$1@wisteria.csv.warwick.ac.uk>
Michel Rodriguez <mirod@xmltwig.com> wrote:
> Is there any specific reason why you chose to use XML::Parser?
> XML::Parser is really a low level module, that IMHO should not be used
> directly.
I was under the impression that XML::Parser was more-or-less
deprecated now, in favour of SAX... is that not correct?
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
/Alcestis/) [ flame, and falls out of sight. ] ben@morrow.me.uk
------------------------------
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 6136
***************************************