[26383] in Perl-Users-Digest
Perl-Users Digest, Issue: 8554 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 22 06:05:27 2005
Date: Sat, 22 Oct 2005 03:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 22 Oct 2005 Volume: 10 Number: 8554
Today's topics:
apache logs <news@cutmeukjay.com>
Re: getElementsByTagName, tag does not exist robic0@yahoo.com
Re: getElementsByTagName, tag does not exist robic0@yahoo.com
How to get the exact path of a script <vikrantDELETE@REMOVEsaysnetsoft.com>
Re: How to get the exact path of a script (Anno Siegel)
Re: How to get the exact path of a script <vikrantDELETE@REMOVEsaysnetsoft.com>
JPL? <"v.niekerk at hccnet.nl">
Re: JPL? <tassilo.von.parseval@rwth-aachen.de>
Re: JPL? <"v.niekerk at hccnet.nl">
Re: JPL? <tassilo.von.parseval@rwth-aachen.de>
Re: XML Parsing robic0@yahoo.com
Re: XML Parsing robic0@yahoo.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Oct 2005 10:17:11 +0100
From: "PhEaSaNt PLuCKeR" <news@cutmeukjay.com>
Subject: apache logs
Message-Id: <djd02m$nre$1@newsg4.svr.pol.co.uk>
Keywords: apache, port
Hi
Can anyone advise me what is going on here please?
64.12.165.33 - - [22/Oct/2005:09:34:57 +0100] "CONNECT 64.12.165.56:6666
HTTP/1.0" 405 315
64.12.165.33 - - [22/Oct/2005:09:34:57 +0100] "POST
http://64.12.165.56:6666/ HTTP/1.0" 200 2335
I notice this in my logs now and then, is it easy to simulate this with
perl?
Thanks in anticipation
James
--
PhEaSaNt PLuCKeR
------------------------------
Date: Fri, 21 Oct 2005 23:44:49 -0700
From: robic0@yahoo.com
Subject: Re: getElementsByTagName, tag does not exist
Message-Id: <1pnjl1h5rc07kl4jprrqtmiiicao8tpaji@4ax.com>
On Thu, 20 Oct 2005 08:04:45 -0400, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:
Actually, your right! Analysis always does the trick.
I personally would not do DOM, I want intimate controll.
I feel I can controll the entire event driven model,
on data large and small. Dom will fade imho, but
you have a point..
>
><robic0@yahoo.com> wrote in message
>news:cmfel1pas2i6b65oadd4ub42u9dvmt6cf8@4ax.com...
>> On Tue, 11 Oct 2005 23:11:25 -0700, robic0@yahoo.com wrote:
>
>[ TOFU corrected ]
>
>>>The alternative to DOM is SAX, widely used in modern code.
>>>Its basically a simple event driven model, calling handlers
>>>when the basic structured xml components are encountered. This
>>>allows you to control going from xml to internal data structures
>>>and/or back out to xml. Expat provides hooking handlers to most
>>>of the current W3c constructs. These are just the basic ones.
>>>Its up to you to extract the data into internal structures.
>>>For that XML:Simple is a good tool. With Expat you can accumulate
>>>nested data in a single string. Then Simple will create nested
>>>Perl structures using tag names. Then you can Dumper it.
>
>> You know, I'm gonna go one step further here and say:
>> If you use nodes your some kind of a dumb ass. Not the
>> modern thinking at all !!
>
>Your logic has me convinced. Oh wait, there is no logic. You do realize that
>you're just trying to create your own DOM tree by jumping through a bunch of
>hoops, right? SAX will let you do that, but I don't see how what you're
>suggesting would be an improvement over a regular DOM tree.
>
>SAX has its uses (especially for large documents you don't want to read into
>memory), but it's hardly a reason not to use DOM. If I need the whole
>document in memory before beginning to process, SAX is a needlessly complex
>way of doing that. If I just want to fire off events as I come across
>elements, DOM is a needlessly complex way of doing that.
>
>Picking one method over the other requires analyzing what your needs are.
>Simplistic statements like sax for everything aren't helpful.
>
>Matt
>
------------------------------
Date: Fri, 21 Oct 2005 23:49:31 -0700
From: robic0@yahoo.com
Subject: Re: getElementsByTagName, tag does not exist
Message-Id: <e5ojl1hdas8utf88tt1mknpsullko6gi29@4ax.com>
On Thu, 20 Oct 2005 08:04:45 -0400, "Matt Garrish"
I didn't getcha on this statement..
<matthew.garrish@sympatico.ca> wrote:
>Simplistic statements like sax for everything aren't helpful.
>
>Matt
>
------------------------------
Date: Sat, 22 Oct 2005 13:04:22 +0530
From: "vikrant@saysnetsoft.com" <vikrantDELETE@REMOVEsaysnetsoft.com>
Subject: How to get the exact path of a script
Message-Id: <djcq5d$cmb$2@domitilla.aioe.org>
hi,
i have a script example.pl currently store at location "/home/vikrant/scripts/".
Now,what i want to do is to find the above path means where
my script(example.pl) store or currently exists when i run
my script(example.pl) in the following different ways:-
1.
>cd /home/
>perl vikrant/scripts/example.pl
the output i need is /home/vikrant/scripts/
2.
>cd /home/sameer/
>perl /home/vikrant/scripts/example.pl
this time the output i need is same means "/home/vikrant/scripts/".
Please tell me how can i get the exact path of my script
while executing it from different location.
Thanks
Vikrant
------------------------------
Date: 22 Oct 2005 09:13:14 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to get the exact path of a script
Message-Id: <djcvra$ke4$1@mamenchi.zrz.TU-Berlin.DE>
vikrant@saysnetsoft.com <vikrantDELETE@REMOVEsaysnetsoft.com> wrote in comp.lang.perl.misc:
> hi,
>
> i have a script example.pl currently store at location "/home/vikrant/scripts/".
>
> Now,what i want to do is to find the above path means where
> my script(example.pl) store or currently exists when i run
> my script(example.pl) in the following different ways:-
perldoc FindBin
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Sat, 22 Oct 2005 15:33:00 +0530
From: "vikrant@saysnetsoft.com" <vikrantDELETE@REMOVEsaysnetsoft.com>
Subject: Re: How to get the exact path of a script
Message-Id: <djd2s6$o3g$1@domitilla.aioe.org>
hi,
Thanks for the information.
Regards,
Vikrant
------------------------------
Date: Sat, 22 Oct 2005 06:30:29 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: JPL?
Message-Id: <4359c065$0$765$3a628fcd@reader10.nntp.hccnet.nl>
Hi,
I'm looking for JPL, and the Perl-faq tells me to go to "See jpl/README
in the Perl source tree" but I can't find it. Any directions please?
Thanks,
Huub
------------------------------
Date: Sat, 22 Oct 2005 08:53:05 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: JPL?
Message-Id: <3ru5umFligssU1@news.dfncis.de>
Also sprach Huub:
> Hi,
>
> I'm looking for JPL, and the Perl-faq tells me to go to "See jpl/README
> in the Perl source tree" but I can't find it. Any directions please?
How do you mean, you cannot find it?
ethan@ethan:~/Projects/APC$ ls -l perl-current/jpl/
total 64
-r--r--r-- 1 ethan ethan 891 Apr 8 2001 ChangeLog
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JNI
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JPL
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JPL_Rolo
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 PerlInterpreter
-r--r--r-- 1 ethan ethan 6748 Apr 8 2001 README
-r--r--r-- 1 ethan ethan 3192 Apr 8 2001 README.JUST-JNI
-r--r--r-- 1 ethan ethan 195 Aug 1 2000 SETVARS.PL
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 Sample
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 Test
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 bin
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 docs
drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 get_jdk
-r-xr-xr-x 1 ethan ethan 5157 Aug 1 2000 install-jpl
It's also there in 5.8.6. How could you not have found it?
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Sat, 22 Oct 2005 10:34:12 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: JPL?
Message-Id: <4359f986$0$162$3a628fcd@reader1.nntp.hccnet.nl>
> How do you mean, you cannot find it?
>
> ethan@ethan:~/Projects/APC$ ls -l perl-current/jpl/
> total 64
> -r--r--r-- 1 ethan ethan 891 Apr 8 2001 ChangeLog
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JNI
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JPL
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JPL_Rolo
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 PerlInterpreter
> -r--r--r-- 1 ethan ethan 6748 Apr 8 2001 README
> -r--r--r-- 1 ethan ethan 3192 Apr 8 2001 README.JUST-JNI
> -r--r--r-- 1 ethan ethan 195 Aug 1 2000 SETVARS.PL
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 Sample
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 Test
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 bin
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 docs
> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 get_jdk
> -r-xr-xr-x 1 ethan ethan 5157 Aug 1 2000 install-jpl
>
> It's also there in 5.8.6. How could you not have found it?
>
Because 'find / -name jpl' doesn't show anything on my system and I have
5.8.6 installed.
------------------------------
Date: Sat, 22 Oct 2005 10:50:13 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: JPL?
Message-Id: <3rucq7Flais9U1@news.dfncis.de>
Also sprach Huub:
>> How do you mean, you cannot find it?
>>
>> ethan@ethan:~/Projects/APC$ ls -l perl-current/jpl/
>> total 64
>> -r--r--r-- 1 ethan ethan 891 Apr 8 2001 ChangeLog
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JNI
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JPL
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 JPL_Rolo
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 PerlInterpreter
>> -r--r--r-- 1 ethan ethan 6748 Apr 8 2001 README
>> -r--r--r-- 1 ethan ethan 3192 Apr 8 2001 README.JUST-JNI
>> -r--r--r-- 1 ethan ethan 195 Aug 1 2000 SETVARS.PL
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 Sample
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 Test
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 bin
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 docs
>> drwxr-xr-x 2 ethan ethan 4096 Nov 24 2004 get_jdk
>> -r-xr-xr-x 1 ethan ethan 5157 Aug 1 2000 install-jpl
>>
>> It's also there in 5.8.6. How could you not have found it?
>>
>
> Because 'find / -name jpl' doesn't show anything on my system and I have
> 5.8.6 installed.
Ah, so you don't actually have the source-tree around which the FAQ
mentions. Just grab the appropriate version from the CPAN or so and in
there you'll find the jpl/ directory.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Fri, 21 Oct 2005 22:58:01 -0700
From: robic0@yahoo.com
Subject: Re: XML Parsing
Message-Id: <c5jjl19j6mm299e9rc9m8s6hfggkp190tq@4ax.com>
On 29 Sep 2005 17:51:53 GMT, xhoster@gmail.com wrote:
>I'm currently using XML::Parser to process some XML. I am wondering what
>else is out there. A search of CPAN on 'XML' reveals that there is way
>more out there than I can possible evaluate, but that most of it is not
>general XML processing modules, but rather for very specific tasks which
>just happen to involve XML.
>
>I'd like to be familiar with the major alternatives to XML::Parser, without
>having to read 3689 different perldoc pages to find those major
>alternatives. So, what are your favorite Perl modules for general-purpose
>XML processing?
>
>Thanks,
>
>Xho
I guess I'll try to revisit your post even it being 2 weeks later.
It isin't possible to know from your questions what would be good for
you. I use multiple methods to manipulate XML. In Perl, thats just the
way it is right now. Theres simple xml and there is complex "nested
entities" xml. Sometimes knowing what it is your trying to do helps
better. In reality, there is no "one source" xml solution.
Some of the basic concerns are if your reading/writing, validating,
DOM and/or SAX. The current trend for reading is SAX a "roll your
own" event driven solution as opposed to the "node" approach of a
DOM.
With SAX, (XML:Parser, I use Expat which is a layer above I think)
you can set handlers for start (with attributes)/end tags as well
as content handlers and every w3c entity you wish. Be careful as this
is easy to process with simple closures (non-nested entities).
For example, lets say a known, compound (nested) structure is
coming down the pipe. After you start filling the container, you know
a certain inner container tag of <BigTag><tag1>content</tag1>
<tag2>content</tag2><tag3>content</tag3><tag4>content</tag4></BigTag>
sequence. As soon as the "BigTag" is trigged you start accumulating
everything between <BigTag> and </BigTag>. When you have the string,
you pass it to Simple to create a hash array that gets embedded
into you containter structure, the "tag#" being the key, the content
the value.
So, you have to break it up this way and use what is known. Simple
will work on simple xml (non-nested entities) to get what your
interested in. Simple has to be tweaked too.
While all this is going on, parser calls have to be wrapped in eval's
and acted upon to trap errors.
For "unknown" casual reading of xml for display purposes, use
Microsoft browser (it dosen't use Perl).
I use ActiveState's perl and use Expat, Simple, Xerces (Apache).
I also use them with Perl2Exe (-tiny) on a commercial level app.
So I guess you have to ask yourself what it is exactly you want
to do. Perl and XML don't fit hand in glove, if your looking for
something "quick & dirty" you will not find the solution in Perl.
Hope this helps a little....
------------------------------
Date: Sat, 22 Oct 2005 00:26:15 -0700
From: robic0@yahoo.com
Subject: Re: XML Parsing
Message-Id: <rnpjl1h3bqjiun8t09vfl7gffnhmup5kt6@4ax.com>
On Fri, 21 Oct 2005 22:58:01 -0700, robic0@yahoo.com wrote:
>On 29 Sep 2005 17:51:53 GMT, xhoster@gmail.com wrote:
>
>>I'm currently using XML::Parser to process some XML. I am wondering what
>>else is out there. A search of CPAN on 'XML' reveals that there is way
>>more out there than I can possible evaluate, but that most of it is not
>>general XML processing modules, but rather for very specific tasks which
>>just happen to involve XML.
>>
>>I'd like to be familiar with the major alternatives to XML::Parser, without
>>having to read 3689 different perldoc pages to find those major
>>alternatives. So, what are your favorite Perl modules for general-purpose
>>XML processing?
>>
>>Thanks,
>>
>>Xho
>I guess I'll try to revisit your post even it being 2 weeks later.
>It isin't possible to know from your questions what would be good for
>you. I use multiple methods to manipulate XML. In Perl, thats just the
>way it is right now. Theres simple xml and there is complex "nested
>entities" xml. Sometimes knowing what it is your trying to do helps
>better. In reality, there is no "one source" xml solution.
>Some of the basic concerns are if your reading/writing, validating,
>DOM and/or SAX. The current trend for reading is SAX a "roll your
>own" event driven solution as opposed to the "node" approach of a
>DOM.
>With SAX, (XML:Parser, I use Expat which is a layer above I think)
>you can set handlers for start (with attributes)/end tags as well
>as content handlers and every w3c entity you wish. Be careful as this
>is easy to process with simple closures (non-nested entities).
>For example, lets say a known, compound (nested) structure is
>coming down the pipe. After you start filling the container, you know
>a certain inner container tag of <BigTag><tag1>content</tag1>
><tag2>content</tag2><tag3>content</tag3><tag4>content</tag4></BigTag>
>sequence. As soon as the "BigTag" is trigged you start accumulating
>everything between <BigTag> and </BigTag>. When you have the string,
>you pass it to Simple to create a hash array that gets embedded
>into you containter structure, the "tag#" being the key, the content
>the value.
>So, you have to break it up this way and use what is known. Simple
>will work on simple xml (non-nested entities) to get what your
>interested in. Simple has to be tweaked too.
>While all this is going on, parser calls have to be wrapped in eval's
>and acted upon to trap errors.
>For "unknown" casual reading of xml for display purposes, use
>Microsoft browser (it dosen't use Perl).
>I use ActiveState's perl and use Expat, Simple, Xerces (Apache).
>I also use them with Perl2Exe (-tiny) on a commercial level app.
>So I guess you have to ask yourself what it is exactly you want
>to do. Perl and XML don't fit hand in glove, if your looking for
>something "quick & dirty" you will not find the solution in Perl.
>Hope this helps a little....
Followup, you might find the "quick & dirty" in Perl, but it
won't be the complete answer. I have found the complete "read"
answer in Perl including validation (using Xerces). I would
only use Xerces in the "write" answer and not Simple or
any other solution. To use Xerces, you have to scoure the
C++ source code and its hit and miss, mostly miss. As
of this date, schema checking works excelent using Xerces
pm interface. It took me so much time to test interface
(but only as it pertains to schema) I may revisit C proto's
and publish (where author just used a bot creator) actual
implemtation.
>
------------------------------
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 8554
***************************************