[25021] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7271 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 19 18:12:16 2004

Date: Tue, 19 Oct 2004 15:10:13 -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           Tue, 19 Oct 2004     Volume: 10 Number: 7271

Today's topics:
        HTTP Proxy via HTTP Layer by Perl? <nntp@rogers.com>
    Re: HTTP Proxy via HTTP Layer by Perl? <nntp@rogers.com>
    Re: HTTP Proxy via HTTP Layer by Perl? <1usa@llenroc.ude.invalid>
    Re: HTTP Proxy via HTTP Layer by Perl? <nntp@rogers.com>
    Re: Is this really legal? (Anno Siegel)
    Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multi <vijai.lists@gmail.com>
    Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multi <vijai.lists@gmail.com>
    Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multi <vijai.lists@gmail.com>
    Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multi <mritty@gmail.com>
    Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multi <tadmc@augustmail.com>
    Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multi <tadmc@augustmail.com>
    Re: options to shrink-wrap a perl script (J. Romano)
    Re: options to shrink-wrap a perl script (dan baker)
    Re: options to shrink-wrap a perl script <uguttman@athenahealth.com>
    Re: options to shrink-wrap a perl script <ebohlman@omsdev.com>
    Re: options to shrink-wrap a perl script <uguttman@athenahealth.com>
    Re: options to shrink-wrap a perl script <tadmc@augustmail.com>
        Perl Whirl IV from Dubrovnik <perl@my-header.org>
    Re: Perl Whirl IV from Dubrovnik <dwall@fastmail.fm>
        Perl XML Parser DOM Tag Handler sample code .... (Sherbo)
        Problem while changing file's modification time using u (Sudeep George)
    Re: Problem while changing file's modification time usi <Jon.Ericson@jpl.nasa.gov>
    Re: regex to clean path <uguttman@athenahealth.com>
    Re: regex to clean path <bik.mido@tiscalinet.it>
    Re: regex to clean path <bik.mido@tiscalinet.it>
    Re: regex to clean path <abigail@abigail.nl>
    Re: Regular Expression for HTML Tags and Special Charac <Jon.Ericson@jpl.nasa.gov>
        Special encoded character <yoann.wyffels@iloahosting.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 19 Oct 2004 16:56:28 -0400
From: "nntp" <nntp@rogers.com>
Subject: HTTP Proxy via HTTP Layer by Perl?
Message-Id: <nsKdnWDkpf0F4ujcRVn-1A@rogers.com>

I am not sure how proxy works. The basic is it got a request then forward
it.

I need a perl program for doing that. There are windows, binary based
proxys. However, I have to have broadband to use it, then it will cost $50 a
month for only fast down, but slow up. If I have a Perl/PHP proxy, and use
web server port 80, then I only need to pay $10 web hosting fee for super
fast connections up and down.

I searched cpan but there is none like that. I went to hotscripts. The only
proxy is web based. But I need http layer so that I just enter the ip and
port in browser then I am ready to go.

Anyone knows such programs?




------------------------------

Date: Tue, 19 Oct 2004 17:03:20 -0400
From: "nntp" <nntp@rogers.com>
Subject: Re: HTTP Proxy via HTTP Layer by Perl?
Message-Id: <Q_qdnbQqF56oHOjcRVn-vg@rogers.com>

> I am not sure how proxy works. The basic is it got a request then forward
> it.
>
> I need a perl program for doing that. There are windows, binary based
> proxys. However, I have to have broadband to use it, then it will cost $50
a
> month for only fast down, but slow up. If I have a Perl/PHP proxy, and use
> web server port 80, then I only need to pay $10 web hosting fee for super
> fast connections up and down.
>
> I searched cpan but there is none like that. I went to hotscripts. The
only
> proxy is web based. But I need http layer so that I just enter the ip and
> port in browser then I am ready to go.
>
> Anyone knows such programs?
>

There are some on cpan. Because I don't know much about the technical terms,
so I am not sure which is which

http://search.cpan.org/~rwahby/Net-HTTPTunnel-0.4/HTTPTunnel.pm
http://search.cpan.org/~book/HTTP-Proxy-0.13/lib/HTTP/Proxy.pm

I could not match what it does to what I am trying to do.




------------------------------

Date: 19 Oct 2004 21:08:43 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: HTTP Proxy via HTTP Layer by Perl?
Message-Id: <Xns9587AE698E474asu1cornelledu@132.236.56.8>

"nntp" <nntp@rogers.com> wrote in
news:Q_qdnbQqF56oHOjcRVn-vg@rogers.com: 

>> I am not sure how proxy works. The basic is it got a request then
>> forward it.
>>
>> I need a perl program for doing that. There are windows, binary based
>> proxys. However, I have to have broadband to use it, then it will
>> cost $50 a month for only fast down, but slow up. If I have a
>> Perl/PHP proxy, and use web server port 80, then I only need to pay
>> $10 web hosting fee for super fast connections up and down.

I am not sure why this is relevant. This is a programming newsgroup. If you 
are working on a program, and have a question regarding that program which 
we hope is in Perl, then you post it here and get help.

>> I searched cpan but there is none like that. I went to hotscripts.
>> The only proxy is web based. But I need http layer so that I just 
>> enter the ip and port in browser then I am ready to go.
>>
>> Anyone knows such programs?

Yes: http://www.research.att.com/~hpk/wsp/

Sinan.


------------------------------

Date: Tue, 19 Oct 2004 17:57:49 -0400
From: "nntp" <nntp@rogers.com>
Subject: Re: HTTP Proxy via HTTP Layer by Perl?
Message-Id: <BqydnQLhzKdnEOjcRVn-vA@rogers.com>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> дÈëÓʼþ
news:Xns9587AE698E474asu1cornelledu@132.236.56.8...
> "nntp" <nntp@rogers.com> wrote in
> news:Q_qdnbQqF56oHOjcRVn-vg@rogers.com:
>
> >> I am not sure how proxy works. The basic is it got a request then
> >> forward it.
> >>
> >> I need a perl program for doing that. There are windows, binary based
> >> proxys. However, I have to have broadband to use it, then it will
> >> cost $50 a month for only fast down, but slow up. If I have a
> >> Perl/PHP proxy, and use web server port 80, then I only need to pay
> >> $10 web hosting fee for super fast connections up and down.
>
> I am not sure why this is relevant. This is a programming newsgroup. If
you
> are working on a program, and have a question regarding that program which
> we hope is in Perl, then you post it here and get help.
I posted two modules from cpan and ask if they are what I need

>
> >> I searched cpan but there is none like that. I went to hotscripts.
> >> The only proxy is web based. But I need http layer so that I just
> >> enter the ip and port in browser then I am ready to go.
> >>
> >> Anyone knows such programs?
>
> Yes: http://www.research.att.com/~hpk/wsp/
I don't understand the program. I don't see any demo either. It looks like
to me a fake clicking software. I am not asking for that. I need about 5-10
private proxy servers set up around the world for a trading business. I need
the lowest cost way.



>
> Sinan.




------------------------------

Date: 19 Oct 2004 11:30:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Is this really legal?
Message-Id: <cl2tsj$862$1@mamenchi.zrz.TU-Berlin.DE>

Ben Morrow  <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
> 
> Quoth tim@vegeta.ath.cx:
> > The are not required in the statement modifier form, but STATEMENT may
> > be a block if desired.
> 
> Not true. In Perl (unlike C) a statement is a statement and a block a
> block. You can, however, make a statement out of a block by 'do'ing it:
> 
> do { $x = $y } unless defined $x;
> 
> I would *very strongly* recommend against *ever* casting an if like
> this; ...

Why the objection?

I agree that it may be considered silly to force a block into a
statement just to apply a statement modifier when there is also
a form that deals with blocks right away.  But that doesn't make
it wrong.

I use that form occasionally to debug a statement modifier when it's
clear that the "do {}" will later go away again.

Anno


------------------------------

Date: Tue, 19 Oct 2004 13:51:15 -0500
From: Vijayaraghavan Kalyanapasupathy <vijai.lists@gmail.com>
Subject: Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multiline comments. No matches found.
Message-Id: <MPG.1bdf1e21d0271e18989680@news.vanderbilt.edu>

Hello,
 
> Obviously, you didn't get it right.   You're using a character class 
> which matches an actual period, vertical-bar, or a newline.  Keep 
> reading the documentation in your Camel or in
> perldoc perlretut
> perldoc perlre

Oh I see, I figured that meta-characters will work inside a character 
class specification as well. My mistake.

> The correct way to get the period to match a newline is to add the /s 
> modifier onto your regexp.
> 
> > Any suggestions?
> 
> 1) Keep reading the documentation.  (That's not a criticism, it's a 
> compliment - too many questioners in this group don't read and just 
> expect everyone to read the docs to them).  Specifically, you need to 
> read up on character classes and regexp modifiers.
> 2) if you're doing this as a learning exercise, make . match the newline 
> the correct way.

Yep. I am working my way through the Camel book; a couple hours of 
experimenting every day. That's why I seem to rush off and write a 
program without reading everything completely. 

> 3) If you're doing this for production code, don't bother rolling your 
> own solution - check the Perl FAQ before doing something like this:
> perldoc -q comment
> 
> Paul Lalli
> 

Thanx for the comments,

-vijai.


------------------------------

Date: Tue, 19 Oct 2004 13:52:36 -0500
From: Vijayaraghavan Kalyanapasupathy <vijai.lists@gmail.com>
Subject: Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multiline comments. No matches found.
Message-Id: <MPG.1bdf1e6df84b21cd989681@news.vanderbilt.edu>

hello,

> 
> CPAN has nice module for matching common regexps, that is if you don't
> insist on bondage/your own solution. :)
> 
> http://search.cpan.org/~abigail/Regexp-Common-2.117/lib/Regexp/Common.pm
> Regexp::Common::comment

No, I would like to write my own programs, at least while I am learning.

Thanx for the link though, it should be quite useful later on.

-vijai.


------------------------------

Date: Tue, 19 Oct 2004 13:54:37 -0500
From: Vijayaraghavan Kalyanapasupathy <vijai.lists@gmail.com>
Subject: Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multiline comments. No matches found.
Message-Id: <MPG.1bdf1eed8a16878c989682@news.vanderbilt.edu>

Hello,
 
> Well, as long as you read in the file line-by-line and match each line
> separately, you will *never* find a multiline match.

Now, why didn't I think of that. Thanx for pointing it out.

> I'd write the program as follows (untested!):
> 
>     use strict;       #  I'm still learning, I need strict.
>     use warnings;     #  Cause I ain't perfect.
> 

I will look this up. Maybe I should be using these too?

thanx for your example, but I will work my way to figuring it out on my 
own. It wouldn't do to copy paste your example, although I understand 
some of it, I am not familiar enuf with perl yet to try this on my own.

-vijai.


------------------------------

Date: Tue, 19 Oct 2004 19:14:56 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multiline comments. No matches found.
Message-Id: <QIddd.13967$fP3.7304@trndny05>

"Vijayaraghavan Kalyanapasupathy" <vijai.lists@gmail.com> wrote in
message news:MPG.1bdf1eed8a16878c989682@news.vanderbilt.edu...

[Attirbutions added back in - please don't delete the bits that tell us
who said what]

> Abigail wrote:

> > I'd write the program as follows (untested!):
> >
> >     use strict;       #  I'm still learning, I need strict.
> >     use warnings;     #  Cause I ain't perfect.
> >
>
> I will look this up. Maybe I should be using these too?

No maybe about it.  You should always be using strict and warnings,
especially when teaching yourself Perl.

Paul Lalli




------------------------------

Date: Tue, 19 Oct 2004 16:45:28 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multiline comments. No matches found.
Message-Id: <slrncnb2no.1s4.tadmc@magna.augustmail.com>

Vijayaraghavan Kalyanapasupathy <vijai.lists@gmail.com> wrote:

>> Obviously, you didn't get it right.   You're using a character class 
>> which matches an actual period, vertical-bar, or a newline.

> Oh I see, I figured that meta-characters will work inside a character 
> class specification as well. My mistake.


Meta-characters *do* work inside of a character class, but since it
is its own language distinct from the regular expression language
(and from the Perl language), which characters are meta is different.

There are only 4 meta-characters in a character class:

   ]     ends the class if it is not the 1st char in the class

   ^     negates the class if it is the 1st char, else it is not meta

   -     forms a range unless it it 1st or last, in which case it
         is not meta

   \     used to remove the meta-ness of the other three



To compare a few meta-chars in the 3 languages:

   .     (dot, period, full-stop)

        Perl: string concatenation
        regex: matches any char except newline
        char class: is not meta


   ^    (caret)

        Perl: bitwise exclusive or
        regex: matches beginning of string
        char class: negates the class


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 19 Oct 2004 16:49:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: m/(\/\*[.|\n]*\*\/)/ to try and match C-Style multiline comments. No matches found.
Message-Id: <slrncnb2ue.1s4.tadmc@magna.augustmail.com>

Vijayaraghavan Kalyanapasupathy <vijai.lists@gmail.com> wrote:

>> I'd write the program as follows (untested!):
>> 
>>     use strict;       #  I'm still learning, I need strict.
>>     use warnings;     #  Cause I ain't perfect.
>> 
> 
> I will look this up. Maybe I should be using these too?


No "maybe" about it.

They are Perl's "seatbelts". They help find common mistakes.

Wearing seatbelts is important all the time, but doubly so when
you are just learning how to drive.  :-)



You can read up on them via perldoc:

   perldoc strict

   perldoc warnings

   perldoc perllexwarn


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 19 Oct 2004 08:58:15 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: options to shrink-wrap a perl script
Message-Id: <b893f5d4.0410190758.7bd4aa2c@posting.google.com>

botfood@yahoo.com (dan baker) wrote in message news:<13685ef8.0410171212.3f29430b@posting.google.com>...
> 
> any ideas on free/cheap software to allow my to "compile"
> a simple script into something that can be easily installed
> and executed in Windows on a PC without installing Perl?


Dear Dan,

   I've needed to do the same thing on several occasions.  Creating a
stand-alone executable allows Win32 users who haven't installed Perl
(or who are unable to install Perl for some obscure reason that you
can't figure out because their computer system lies several states
away) to run your Perl script as if Perl were correctly installed on
their systems.

   To create a stand-along executable for Win32, I recommend you try
the PAR module with ActiveState Perl.

   To use it, you first need ActiveState ActivePerl for Win32.  You
can download it at http://www.activestate.com/ .  Once you have
downloaded and installed ActivePerl, you can easily install the PAR
module using ActiveState's ppm installer by typing (at a shell
prompt):

      ppm install PAR

This should download and install the "pp.bat" executable, which will
allow you to convert a Perl script (for example, one named
"myscript.pl") to a stand-alone executable (for example, one named
"myscript.exe") with a command like:

      pp myscript.pl -o myscript.exe

Note:  if it complains that the Module::ScanDeps module is missing,
you can install it with the shell command:

      ppm install Module-ScanDeps

   Also note that the resulting executable will be extremely large in
size... about 1.5 Megabytes for just a simple little Perl script! 
This is due in part because so much of Perl functionality has to be
included in the executable, whether you think you need it or not.  As
a side-effect, the stand-alone executable runs just about as fast as
invoking the perl interpreter on your Perl script.  In other words,
don't think that just because the executable no longer depends on
perl.exe it will all of a sudden run much faster.

   So you may not get the benefits of speed and efficiency by
converting your Perl script into a stand-alone executable, but at
least you'll be able to distribute your program to Win32 users who are
unable (or too lazy) to install Perl on their machines.

   (And please don't be upset by the brevity of the other responses
posted by other regulars of this newsgroup.  Quite a lot of questions
are posted to this newsgroup, and if every response was as detailed as
the one I just gave you, few people would ever get responses.  So it's
common to see just a minimal response to a problem, and nothing more
than what was asked.  If you want more advice, sometimes you need to
be more specific as to what you're looking for, even if that means
posting another question to the newsgroup.)

   I hope this helps, Dan.

   -- Jean-Luc


------------------------------

Date: 19 Oct 2004 11:02:28 -0700
From: botfood@yahoo.com (dan baker)
Subject: Re: options to shrink-wrap a perl script
Message-Id: <13685ef8.0410191002.4ff8e9e9@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message 

> typing "perl PAR" into the little box at www.google.com finds it
> just fine.
> 
> Do you want us to hold your hand?
----------------

I dont need hand-holding, but I do appreciate polite and complete
answers that dont require additional fishing around to figure out what
they are about. With 5 more seconds of effort the original response
would have been help, complete, and friendly without requiring an
additional google to figure it out.

I'd like to think that this group is to get/give answers as
efficiently as possible, not create mysteries crafted as personal
growth projects.

It continues to amaze me that some of the arguably most knowledgable
posters in this newsgroup spend more energy flaming people for
ignorance than they do composing reasonable responses.

d


------------------------------

Date: Tue, 19 Oct 2004 14:12:32 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: options to shrink-wrap a perl script
Message-Id: <m33c0amvan.fsf@linux.local>

>>>>> "db" == dan baker <botfood@yahoo.com> writes:

  db> Tad McClellan <tadmc@augustmail.com> wrote in message 
  >> typing "perl PAR" into the little box at www.google.com finds it
  >> just fine.
  >> 
  >> Do you want us to hold your hand?
  db> ----------------

  db> I dont need hand-holding, but I do appreciate polite and complete
  db> answers that dont require additional fishing around to figure out what
  db> they are about. With 5 more seconds of effort the original response
  db> would have been help, complete, and friendly without requiring an
  db> additional google to figure it out.

that is called hand holding. with 5 seconds of google searching you
would have found plenty on PAR. but you want hundreds of others to do
your work for you and then you complain about not having your hand
held. how sweet!

  db> I'd like to think that this group is to get/give answers as
  db> efficiently as possible, not create mysteries crafted as personal
  db> growth projects.

we like to think of it not as a help desk but as a perl discussion
group. what you think about it doesn't matter. and what is the mystery
when you are directly given the answer? oh, that you don't get spoon
fed. sorry, your mother doesn't know enough perl for that.

  db> It continues to amaze me that some of the arguably most
  db> knowledgable posters in this newsgroup spend more energy flaming
  db> people for ignorance than they do composing reasonable responses.

ignorance is fully accepted here. laziness and wanting their work done
for them is not. learn the difference.

uri



------------------------------

Date: 19 Oct 2004 18:24:33 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: options to shrink-wrap a perl script
Message-Id: <Xns9587895E7ADAFebohlmanomsdevcom@130.133.1.4>

Uri Guttman <uguttman@athenahealth.com> wrote in
news:m33c0amvan.fsf@linux.local: 

> ignorance is fully accepted here. laziness and wanting their work done
> for them is not. learn the difference.

s/laziness/false laziness/;

True Laziness is the virtue of reducing the amount of work you have to do 
by reducing the amount of work *everyone* has to do.  False Laziness is the 
vice of reducing (or trying to reduce) the amount of work you have to do by 
shifting the burden to everyone else.  True Laziness turns Your Problems 
into Non-Problems; false laziness turns Your Problems into Other People's 
Problems.


------------------------------

Date: Tue, 19 Oct 2004 14:52:27 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: options to shrink-wrap a perl script
Message-Id: <m3y8i2levo.fsf@linux.local>

>>>>> "EB" == Eric Bohlman <ebohlman@omsdev.com> writes:

  EB> Uri Guttman <uguttman@athenahealth.com> wrote in
  EB> news:m33c0amvan.fsf@linux.local: 

  >> ignorance is fully accepted here. laziness and wanting their work done
  >> for them is not. learn the difference.

  EB> s/laziness/false laziness/;

  EB> True Laziness is the virtue of reducing the amount of work you
  EB> have to do by reducing the amount of work *everyone* has to do.
  EB> False Laziness is the vice of reducing (or trying to reduce) the
  EB> amount of work you have to do by shifting the burden to everyone
  EB> else.  True Laziness turns Your Problems into Non-Problems; false
  EB> laziness turns Your Problems into Other People's Problems.

yep. but i think the OP won't care either way.

uri


------------------------------

Date: Tue, 19 Oct 2004 16:33:23 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: options to shrink-wrap a perl script
Message-Id: <slrncnb213.1s4.tadmc@magna.augustmail.com>

dan baker <botfood@yahoo.com> wrote:
> Tad McClellan <tadmc@augustmail.com> wrote in message 
> 
>> typing "perl PAR" into the little box at www.google.com finds it
>> just fine.
>> 
>> Do you want us to hold your hand?
> ----------------
> 
> I dont need hand-holding, 


Yet here you are insisting on hand-holding!


> but I do appreciate polite and complete
> answers that dont require additional fishing around to figure out what
> they are about. With 5 more seconds of effort the original response
> would have been help, complete, and friendly without requiring an
> additional google to figure it out.


And we appreciate polite posters who do not object to spending
5 seconds of *their* time at Google.


> I'd like to think that this group is to get/give answers as
> efficiently as possible, not create mysteries crafted as personal
> growth projects.


Learning how to fish is more valuable than being given a fish.


> It continues to amaze me that some of the arguably most knowledgable
> posters in this newsgroup spend more energy flaming people for
> ignorance than they do composing reasonable responses.


It continues to amaze me that some of the arguably least knowledgable
posters in this newsgroup spend more energy flaming people for 
answering their question than they do Googling.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 19 Oct 2004 20:27:08 +0200
From: Matija Papec <perl@my-header.org>
Subject: Perl Whirl IV from Dubrovnik
Message-Id: <2pman0l8rlpljvp0n67608m63sam6ghoca@4ax.com>


http://misc.linux.hr/geekcruises2004/?lang=en

it's Larry on most of the pictures for everybody wanted to take picture with
him.



-- 
Matija


------------------------------

Date: Tue, 19 Oct 2004 21:52:54 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Perl Whirl IV from Dubrovnik
Message-Id: <Xns9587B5E77BEB3dkwwashere@216.168.3.30>

Matija Papec <perl@my-header.org> wrote:

> http://misc.linux.hr/geekcruises2004/?lang=en
> 
> it's Larry on most of the pictures for everybody wanted to take
> picture with him.

No names with the pictures? I recognize Larry and Randal, but if there 
are other names I might know, it would be pleasant (although by no 
means necessary) to be able to associate a face with them. 


------------------------------

Date: 19 Oct 2004 12:31:10 -0700
From: dankolito@yahoo.com (Sherbo)
Subject: Perl XML Parser DOM Tag Handler sample code ....
Message-Id: <a60f9540.0410191131.2ade016@posting.google.com>

Hello All,

I'm trying to use the latest Xerces XML Perl module for XML file
parsing, but the  documentation is rather limited. Does anyone
recommend a Perl XML parser with well-documented DOM tag handlers?

I want to create a handler for three different XML tags: <a>, <b>, and
<c>. Can someone please provide me some sample code to demonstrate how
to :

1.) Write a Perl DOM XML tag handler (in Xerces or other
well-supported Perl XML mod)?
2.) Use multiple tag handlers while reading in an XML file?

Any information would be helpful.

cheers,
Sherban


------------------------------

Date: 19 Oct 2004 05:24:00 -0700
From: sudeepgeorge@gmail.com (Sudeep George)
Subject: Problem while changing file's modification time using utime() on windows
Message-Id: <91f9ed5e.0410190424.6942795c@posting.google.com>

Hi 

I have implemented a perl script to 'touch' all files in a directory
using utime().
The implementation is working fine, but due to limitations of utime()
on Windows, utime() will not modify the attributes of a file if it is
opened or read-only.
I am using Active State Perl v5.8.4 on a Windows 2000 machine.

There is an existing perl module Win32API::File::Time which addresses
this specific problem. But this perl module is not installed by
default[atleast by Active State]. I would like the people using this
script, to avoid installing a perl module inorder to run the same.

I used Win32::File [GetAttribute , SetAttribute] to handle the
read-only issue. This is working fine.

Any ideas how to handle the case when the file being 'touch'ed is
opened already?

TIA,
Sudeep George.


------------------------------

Date: Tue, 19 Oct 2004 10:34:21 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Problem while changing file's modification time using utime() on windows
Message-Id: <rcgd5ze8vdu.fsf@Jon-Ericson.sdsio.prv>

sudeepgeorge@gmail.com (Sudeep George) writes:

> I have implemented a perl script to 'touch' all files in a directory
> using utime().  The implementation is working fine, but due to
> limitations of utime() on Windows, utime() will not modify the
> attributes of a file if it is opened or read-only.  I am using
> Active State Perl v5.8.4 on a Windows 2000 machine.
>
> There is an existing perl module Win32API::File::Time which
> addresses this specific problem. But this perl module is not
> installed by default[atleast by Active State]. I would like the
> people using this script, to avoid installing a perl module inorder
> to run the same.

It is possible to test at runtime whether or not a module is
available.  Something like:

  eval { require Win32API::File::Time }; 
  my $use_api = $@ ? 0 : 1;

> I used Win32::File [GetAttribute , SetAttribute] to handle the
> read-only issue. This is working fine.

Some touch implementations support a -f option to attempt to touch a
file that does not have the needed permissions.  I notice that the
Solaris and GNU implimentations update files that are owned by the
user regardless of permissions.

> Any ideas how to handle the case when the file being 'touch'ed is
> opened already?

Print an error message?  If the user doesn't have Win32API::File::Time
installed, this would be an ideal time to suggest it.

Jon


------------------------------

Date: Tue, 19 Oct 2004 15:00:07 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: regex to clean path
Message-Id: <m3u0sqleiw.fsf@linux.local>

>>>>> "A" == Abigail  <abigail@abigail.nl> writes:
  A> Uri Guttman (uguttman@athenahealth.com) wrote on MMMMLXVI September
  A> MCMXCIII in <URL:news:m3lle3myju.fsf@linux.local>:
  A> The solution Tad gave,

  A>     $_ = join ':', grep !$seen{$_}++, split /:/;

  A> does preserve order.

true. i was just in a regex mood :).

  A> `'  and that isn't fully tested but it looks ok so far.  it could use an
  A> `'  improvement to remove the 1 while part but i leave that as an exercise

  A> It ain't ok though:

  A>     echo "/bin:/usr/bin:/usr/local/bin" |\
  A>            perl -lpe '1 while s/([^:]+)(.*):\1/$1$2/g'
  A>     /binusr/binusr/local/bin

as i said, it needed more testing. this one passes your input:

echo '/bin:/usr/bin:/usr/local/bin:/bin' |
	perl -lpe '1 while s/([^:]+)((:?:[^:]*)+):\1/$1$2/g'
/bin:/usr/bin:/usr/local/bin

<note the line wrap after the |>

echo 'a/b:/b:b:c:d:c:s:a/b' | perl -lpe '1 while s/([^:]+)((:?:[^:]*)+):\1/$1$2/g'
a/b:/b:c:d:s

seems much better but again, it could use more testing. :)

uri





------------------------------

Date: Tue, 19 Oct 2004 23:24:05 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: regex to clean path
Message-Id: <02kan0te2i90d2c9egkfido71klu2i8fvg@4ax.com>

On Mon, 18 Oct 2004 18:49:57 -0400, Uri Guttman
<uguttman@athenahealth.com> wrote:

>  TM> A regex is not likely the best tool for this job.
>
>while i agree a hash is the best way it does need some ordering control
>as this is a path. so here is a regex solution.

There's an obvious way of using a hash yet preserving order as per
Tad's solution. It can also be cast into a substitution as per my
previous post.

>echo 'a:b:b:c:d:c:s:a' | perl -lpe '1 while s/([^:]+)(.*):\1/$1$2/g'
>a:b:c:d:s

Is there anything wrong with my s///olution?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Tue, 19 Oct 2004 23:40:51 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: regex to clean path
Message-Id: <el1bn0la63rr4td74r1nfv00dfgsdmuvgq@4ax.com>

On Mon, 18 Oct 2004 16:45:22 -0500, parv <parv_@yahooWhereElse.com>
wrote:

>> Does anybody know an elegant oneliner using regex?
>
>No regex, just split(); on top of that, in more than one line ...

[snip code]

Huh?!? 66 lines of code? I'm not even watching into it, but... I
heartily hope that it does *much* more than the OP requested...
;-)

>  printf "Unordered: %s\n\nOrdered: %s\n"
>  , ${ make_path( @paths ) }
>  , ${ make_path_ordered( @paths ) }
>  ;

Hmmm, I couldn't help giving a peek at least into the first few
lines... however this makes me think I should be moderately glad I'm
refusing to read it all!


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 19 Oct 2004 21:49:50 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: regex to clean path
Message-Id: <slrncnb2vu.img.abigail@alexandra.abigail.nl>

Uri Guttman (uguttman@athenahealth.com) wrote on MMMMLXVII September
MCMXCIII in <URL:news:m3u0sqleiw.fsf@linux.local>:
$$ >>>>> "A" == Abigail  <abigail@abigail.nl> writes:
$$   A> Uri Guttman (uguttman@athenahealth.com) wrote on MMMMLXVI September
$$   A> MCMXCIII in <URL:news:m3lle3myju.fsf@linux.local>:
$$   A> The solution Tad gave,
$$  
$$   A>     $_ = join ':', grep !$seen{$_}++, split /:/;
$$  
$$   A> does preserve order.
$$  
$$  true. i was just in a regex mood :).
$$  
$$   A> `'  and that isn't fully tested but it looks ok so far.  it could use an
$$   A> `'  improvement to remove the 1 while part but i leave that as an exercise
$$  
$$   A> It ain't ok though:
$$  
$$   A>     echo "/bin:/usr/bin:/usr/local/bin" |\
$$   A>            perl -lpe '1 while s/([^:]+)(.*):\1/$1$2/g'
$$   A>     /binusr/binusr/local/bin
$$  
$$  as i said, it needed more testing. this one passes your input:
$$  
$$  echo '/bin:/usr/bin:/usr/local/bin:/bin' |
$$  	perl -lpe '1 while s/([^:]+)((:?:[^:]*)+):\1/$1$2/g'
$$  /bin:/usr/bin:/usr/local/bin

Still fails:

    $ echo /bin:/bin | perl -lpe '1 while s/([^:]+)((:?:[^:]*)+):\1/$1$2/g'
    /bin:/bin
    $ echo /bin:/bar:/bin/bar |\
                       perl -lpe '1 while s/([^:]+)((:?:[^:]*)+):\1/$1$2/g'
    /bin:/bar/bar
    $ echo 'poof:oof:of' | perl -lpe '1 while s/([^:]+)((:?:[^:]*)+):\1/$1$2/g'
    poof:oof


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


------------------------------

Date: Tue, 19 Oct 2004 14:53:25 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Regular Expression for HTML Tags and Special Characters
Message-Id: <rcgbreycr3e.fsf@Jon-Ericson.sdsio.prv>

marc.bogaard@gmx.de (Marc Bogaard) writes:

> Hello together!

Hallo!

(In English, the idiom is "Hello all!" or "Hello everyone!" or "Hello
folks!")

> How can I allowed some HTML-Tags like <BR>, <B>, <P> but
> filter out <, >, when they stand alone? 
>
> Must be something like: "^[A-Za-Z0-9\>\<]+$"
> for the < and >, but where do i have to put in my tags?

Do you mean that all of the tags will be on their own line?  Do you
want to remove the tags, everything within the tags or just < and >?
Maybe you could show us some sample input and the expected output?

I modified one of the examples from HTML::Parser to do what I *think*
you want:

#!perl -w
use strict;

use HTML::Parser;

my %allowed = map {$_ => 1} qw{br b p};

HTML::Parser->new(default_h => [sub { print shift }, 'text'],
                    start_h => [sub { my $tag = shift;
                                      print "<$tag>" if $allowed{$tag} },
                                'tagname'],
                      end_h => [sub { my $tag = shift;
                                      print "</$tag>" if $allowed{$tag} },
                                'tagname']
                   )->parse_file(shift || die) || die $!;


Given:

<BR>eakfast every morning <B>efore going to work or <no> lunch for you.
</P>aragraphs like this are </kooky>.

It produces:

<br>eakfast every morning <b>efore going to work or  lunch for you.
</p>aragraphs like this are .

Jon


------------------------------

Date: Tue, 19 Oct 2004 13:27:38 +0200
From: "Yoann Wyffels" <yoann.wyffels@iloahosting.com>
Subject: Special encoded character
Message-Id: <4174fa1f$0$27911$626a14ce@news.free.fr>

Hi,

I catch text from a telnet session (with Net::Telnet Module).
Unfortunately, in what I catch, I've got some strange characters which are 
encode like this: "\195\169.....".
For exemple: \195 = é

I don't know what's encode's name it is...? Do you have an idea ?
And do you know how to transform them into normal character ?

Thx a lot,
Regards,
Yoann.





------------------------------

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 7271
***************************************


home help back first fref pref prev next nref lref last post