[24200] in Perl-Users-Digest
Perl-Users Digest, Issue: 6392 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 13 00:10:36 2004
Date: Mon, 12 Apr 2004 21:10:10 -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 Mon, 12 Apr 2004 Volume: 10 Number: 6392
Today's topics:
Re: PERL web addressing <tore@aursand.no>
Re: PERL web addressing <nospam@bigpond.com>
Re: PERL web addressing <ssadale@nospam.yahoo.com>
Re: PERL web addressing <lv@aol.com>
perl's severe lack of in-line comment ability <jidanni@jidanni.org>
Re: perl's severe lack of in-line comment ability <mikee@mikee.ath.cx>
system or exec <robin @ infusedlight.net>
Re: system or exec <uri@stemsystems.com>
Re: system or exec <matthew.garrish@sympatico.ca>
Re: system or exec <jurgenex@hotmail.com>
Re: system or exec (Sam Holden)
Re: Tough (for me) regex case <matthew.garrish@sympatico.ca>
Re: Tough (for me) regex case <rob_perkins@hotmail.com>
Re: WebExplorer as Perl-CGI <robin @ infusedlight.net>
Re: Why doesn't this UserAgent script work? <tore@aursand.no>
Re: Writing to STDIN <jtc@shell.dimensional.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Apr 2004 01:48:24 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: PERL web addressing
Message-Id: <pan.2004.04.12.23.45.15.319295@aursand.no>
On Mon, 12 Apr 2004 15:27:52 -0400, Dale wrote:
> Anyway, the site in question has all of its links and addresses in the
> form of blah.com/index.pl/[some folder] There are no page or file type
> references visible in either the address bar or status bar and the
> source code in the browser is in the same format. I've seen many sites
> that use a querystring to reference the requested file and process the
> request through a script but never this method.
Why not use a Apache handler to do the job? It's even more professional;
http://www.blah.com/some/path/goes/here/
Of course, '/some/path/goes/here/' doesn't exist, but the Apache handler
has been set up to handle all requests so that it's able to convert that
path to something more useful internally (ie. lookup the path string in a
database or something like that).
For more information:
http://perl.apache.org/
--
Tore Aursand <tore@aursand.no>
"Omit needless words. Vigorous writing is concise. A sentence should
contain no unnecessary words, a paragraph no unnecessary sentences,
for the same reason that a drawing should have no unnecessary lines
and a machine no unnecessary parts." -- William Strunk Jr.
------------------------------
Date: Tue, 13 Apr 2004 10:04:31 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: PERL web addressing
Message-Id: <1529689.9NmAqryZ2L@GMT-hosting-and-pickle-farming>
Dale wrote:
> Probably a dumb question but....
> I ran across a site that is using an addressing technique that impressed
> me and a variation on it could solve a problem I've been working on.
>
> I've been considering setting up a "folder" with a sub-folder representing
> each "page". Then I could have a hidden default executable that would
> validate user agents and users would have a bit of a time knowing what
> language was being used or the server platform. Probably pretty niave but
> a thought.
>
> Anyway, the site in question has all of its links and addresses in the
> form of blah.com/index.pl/[some folder] There are no page or file type
> references visible in either the address bar or status bar and the source
> code in the browser is in the same format. I've seen many sites that use a
> querystring to reference the requested file and process the request
> through a script but never this method.
>
> Thoughts?
> Dale
Use a rewrite rule. I have dozens of them on my sites.
http://httpd.apache.org/docs/misc/rewriteguide.html
gtoomey
------------------------------
Date: Mon, 12 Apr 2004 20:13:22 -0400
From: "ssadale#nospam#yahoo.com" <ssadale@nospam.yahoo.com>
Subject: Re: PERL web addressing
Message-Id: <2bydnQNW5NaCrebdRVn-ig@inoc.net>
That would be a great approach and I'm familiar with settng up IIS to handle
vertual vs physical paths. Unfortunately I'm not terribly well versed in
Apache server administration and the site I'm working on is hosted by an ISP
with their own views on how a site/server should be configured. When I saw
the default.pl/folder addressing scheme I figured it was a PERL module or
method I was unfamiliar with responsible for requesting and serving the
appropriate file(s). I'm being asked to provide "secure" (login) access to a
variety of file types hosted on a remote server and .htaccess is fighting me
on this server. This approach, combined with session cookies seemed workable
since it effectively hides the file path and name. So far every attempt I've
made to request a file from the site I stumbled on has been met with
scripted access; I'm a little impresssed and am curious how they're do it.
the domain is softwingflight.com (my favorite hobby) I haven't checked the
domain registration or service provider yet, just curious about a different
technique.
Thanks for the feedback
Dale
"Tore Aursand" <tore@aursand.no> wrote in message
news:pan.2004.04.12.23.45.15.319295@aursand.no...
> On Mon, 12 Apr 2004 15:27:52 -0400, Dale wrote:
> > Anyway, the site in question has all of its links and addresses in the
> > form of blah.com/index.pl/[some folder] There are no page or file type
> > references visible in either the address bar or status bar and the
> > source code in the browser is in the same format. I've seen many sites
> > that use a querystring to reference the requested file and process the
> > request through a script but never this method.
>
> Why not use a Apache handler to do the job? It's even more professional;
>
> http://www.blah.com/some/path/goes/here/
>
> Of course, '/some/path/goes/here/' doesn't exist, but the Apache handler
> has been set up to handle all requests so that it's able to convert that
> path to something more useful internally (ie. lookup the path string in a
> database or something like that).
>
> For more information:
>
> http://perl.apache.org/
>
>
> --
> Tore Aursand <tore@aursand.no>
> "Omit needless words. Vigorous writing is concise. A sentence should
> contain no unnecessary words, a paragraph no unnecessary sentences,
> for the same reason that a drawing should have no unnecessary lines
> and a machine no unnecessary parts." -- William Strunk Jr.
------------------------------
Date: Mon, 12 Apr 2004 21:59:29 -0500
From: l v <lv@aol.com>
Subject: Re: PERL web addressing
Message-Id: <eIIec.178$Ho2.5236@dfw-read.news.verio.net>
ssadale#nospam#yahoo.com wrote:
> That would be a great approach and I'm familiar with settng up IIS to handle
> vertual vs physical paths. Unfortunately I'm not terribly well versed in
> Apache server administration and the site I'm working on is hosted by an ISP
> with their own views on how a site/server should be configured. When I saw
> the default.pl/folder addressing scheme I figured it was a PERL module or
> method I was unfamiliar with responsible for requesting and serving the
> appropriate file(s). I'm being asked to provide "secure" (login) access to a
> variety of file types hosted on a remote server and .htaccess is fighting me
> on this server. This approach, combined with session cookies seemed workable
> since it effectively hides the file path and name. So far every attempt I've
> made to request a file from the site I stumbled on has been met with
> scripted access; I'm a little impresssed and am curious how they're do it.
> the domain is softwingflight.com (my favorite hobby) I haven't checked the
> domain registration or service provider yet, just curious about a different
> technique.
>
> Thanks for the feedback
> Dale
>
>
> "Tore Aursand" <tore@aursand.no> wrote in message
> news:pan.2004.04.12.23.45.15.319295@aursand.no...
>
>>On Mon, 12 Apr 2004 15:27:52 -0400, Dale wrote:
>>
>>>Anyway, the site in question has all of its links and addresses in the
>>>form of blah.com/index.pl/[some folder] There are no page or file type
>>>references visible in either the address bar or status bar and the
>>>source code in the browser is in the same format. I've seen many sites
>>>that use a querystring to reference the requested file and process the
>>>request through a script but never this method.
>>
>>Why not use a Apache handler to do the job? It's even more professional;
>>
>> http://www.blah.com/some/path/goes/here/
>>
>>Of course, '/some/path/goes/here/' doesn't exist, but the Apache handler
>>has been set up to handle all requests so that it's able to convert that
>>path to something more useful internally (ie. lookup the path string in a
>>database or something like that).
>>
>>For more information:
>>
>> http://perl.apache.org/
>>
>>
>>--
>>Tore Aursand <tore@aursand.no>
>>"Omit needless words. Vigorous writing is concise. A sentence should
>> contain no unnecessary words, a paragraph no unnecessary sentences,
>> for the same reason that a drawing should have no unnecessary lines
>> and a machine no unnecessary parts." -- William Strunk Jr.
>
>
>
Perhaps http://www.oreilly.com/openbook/cgi/ch02_04.html will get you
started.
Len
------------------------------
Date: Tue, 13 Apr 2004 02:56:05 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: perl's severe lack of in-line comment ability
Message-Id: <87smf958l6.fsf@jidanni.org>
Gentlemen, "#" until the end of the line is not good enough for
comments.
Found in perlfaq7.pod
How can I comment out a large block of perl code?
Yes, but what about the very smallest pieces of code? C's */ /* can
be used almost anywhere, but what about perl?
For instance, say I want to comment out "$F[0]," in
perl -nalwe 'print $F[0],$F[1]'
with out otherwise disturbing anything or being interrogated as to my
motives or being told to make it into two lines:
#perl -nalwe 'print $F[0],$F[1]'
perl -nalwe 'print $F[1]'
It seems perl might be in need of a new operator c{}, modeled on q{},
that will comment stuff in-line:
perl -nalwe 'print c{$F[0],}$F[1]'
or something like that.
Of course I didn't check if the name "c" has been used already, or if
this "is impossible to implement", I'm just saying is that Larry
forgot something.
------------------------------
Date: Tue, 13 Apr 2004 00:51:17 -0000
From: Mike <mikee@mikee.ath.cx>
Subject: Re: perl's severe lack of in-line comment ability
Message-Id: <107mec53tq0epa4@corp.supernews.com>
In article <87smf958l6.fsf@jidanni.org>, Dan Jacobson wrote:
> Gentlemen, "#" until the end of the line is not good enough for
> comments.
>
> Found in perlfaq7.pod
> How can I comment out a large block of perl code?
>
> Yes, but what about the very smallest pieces of code? C's */ /* can
> be used almost anywhere, but what about perl?
>
> For instance, say I want to comment out "$F[0]," in
> perl -nalwe 'print $F[0],$F[1]'
> with out otherwise disturbing anything or being interrogated as to my
> motives or being told to make it into two lines:
> #perl -nalwe 'print $F[0],$F[1]'
> perl -nalwe 'print $F[1]'
>
> It seems perl might be in need of a new operator c{}, modeled on q{},
> that will comment stuff in-line:
> perl -nalwe 'print c{$F[0],}$F[1]'
> or something like that.
>
> Of course I didn't check if the name "c" has been used already, or if
> this "is impossible to implement", I'm just saying is that Larry
> forgot something.
Change your method of commenting to fit the language you use.
------------------------------
Date: Mon, 12 Apr 2004 18:21:47 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: system or exec
Message-Id: <c5fghb$vnb$1@reader2.nmix.net>
Which is better, overall in the ammount of time it takes for external
command to be executed, system or exec? Later.
--
Regards,
-Robin
--
robin @ infusedlight.net
------------------------------
Date: Tue, 13 Apr 2004 01:55:18 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: system or exec
Message-Id: <x78yh0fxq1.fsf@mail.sysarch.com>
>>>>> "R" == Robin <robin @ infusedlight.net> writes:
R> Which is better, overall in the ammount of time it takes for external
R> command to be executed, system or exec? Later.
which is better, ford or the atlantic ocean?
your question is like 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: Mon, 12 Apr 2004 21:54:57 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: system or exec
Message-Id: <JLHec.5826$2Z6.406511@news20.bellglobal.com>
"Robin" <robin @ infusedlight.net> wrote in message
news:c5fghb$vnb$1@reader2.nmix.net...
> Which is better, overall in the ammount of time it takes for external
> command to be executed, system or exec? Later.
>
Oh joy, a new foray into the unknown!
Did you bother to read the documentation before posting? If you had, you
just might have hit this gem (buried all the way at the very top of exec, I
could see how you might miss it, though):
The exec function executes a system command and never returns-- use system
instead of exec if you want it to return.
Or gee, what about this beauty at the top of system:
Does exactly the same thing as exec LIST, except that a fork is done first,
and the parent process waits for the child process to complete.
Please try reading the documentation before asking ridiculous questions.
Matt
------------------------------
Date: Tue, 13 Apr 2004 02:12:54 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: system or exec
Message-Id: <G0Iec.24787$hd3.12850@nwrddc03.gnilink.net>
Robin wrote:
> Which is better, overall in the ammount of time it takes for external
> command to be executed, system or exec? Later.
Well, the two have quite different functionality.
It is like asking what is better, overal in the amount of time it takes to
get to a place, a speed boat or a motorcycle?
jue
------------------------------
Date: 13 Apr 2004 02:22:45 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: system or exec
Message-Id: <slrnc7mjnl.1kd.sholden@flexal.cs.usyd.edu.au>
On Mon, 12 Apr 2004 18:21:47 -0700, Robin <robin@infusedlight.net> wrote:
> Which is better, overall in the ammount of time it takes for external
> command to be executed, system or exec? Later.
exec is faster. A *lot* faster when the time spent executing the rest
of your perl code is considered. Slightly faster when you don't - well
on *nix like operating systems anyway.
--
Sam Holden
------------------------------
Date: Mon, 12 Apr 2004 21:39:27 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Tough (for me) regex case
Message-Id: <bxHec.5818$2Z6.401172@news20.bellglobal.com>
"Rob Perkins" <rob_perkins@hotmail.com> wrote in message
news:2mpl70d727sd1r6und5fqbd78s6fhla1fu@4ax.com...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote:
>
> >If there are quotation marks at the beginning and end
> >of the strings, I would hazard a guess that the OP added them somewhere
his
> >code.
>
> Nope.
>
Run your code and find me these mystery quotation marks then:
$_ = 'The "quick" brown "fox jumped ""over"" the" lazy dog.';
my @matches = m/(?<!")"(?!")(.*?)(?<!")"(?!")/g;
foreach (@matches) {
print $_, "\n";
}
Matt
------------------------------
Date: Tue, 13 Apr 2004 03:33:35 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Tough (for me) regex case
Message-Id: <qlnm70p6dqlvmsq9ddrelvo0dtv724rvdu@4ax.com>
"Matt Garrish" <matthew.garrish@sympatico.ca> wrote:
>Run your code and find me these mystery quotation marks then:
Well, that's just the thing, isn't it?
I did.
I posed the question, crossposted on a .NET forum and a Perl forum,
because I figured lotsa regex types hung out there.
Chris Sells' RegexDesigner.NET shows that with that input string and
that regex, the quotemarks are sucked up in the match.
Of course, if you'd rather be dogmatic about it, I guess I'll have to
leave you alone, and slink away with my question unanswered.
My solution? I took the regex in question, and stripped the first and
last character from the matches, essentially getting rid of the quotes
with some post-processing. Works wonderfully.
Rob
------------------------------
Date: Mon, 12 Apr 2004 18:23:45 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: WebExplorer as Perl-CGI
Message-Id: <c5fgmh$vnh$1@reader2.nmix.net>
That's so dangerous, I've been reading up on perl-cgi security thanks to my
latest hackings. Good luck ruining your server. Try www.cgi-resources.com
-Robin
------------------------------
Date: Tue, 13 Apr 2004 01:20:32 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Why doesn't this UserAgent script work?
Message-Id: <pan.2004.04.12.23.20.30.765688@aursand.no>
On Mon, 12 Apr 2004 04:52:01 +0000, Tigerhillside wrote:
>> #!/usr/bin/perl
>> #
> Is that needed?
That extra comment? No. It's just my way of adding some "nice" space in
my scripts.
>> use strict;
>> use warnings;
> Sorry, but is that better than '-w'? I will use it from now on but
> thought either worked.
It is "better", but will only work if you have Perl 5.6.1 (or newer).
--
Tore Aursand <tore@aursand.no>
"The road to hell is full of good intentions." -- Bruce Dickinson
------------------------------
Date: 12 Apr 2004 16:29:19 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Writing to STDIN
Message-Id: <slrnc7m61v.78c.jtc@shell.dimensional.com>
In article <22ee5d47.0404121318.6a28fdd1@posting.google.com>, Hobbit HK wrote:
> Hmmm........ So if it's such a bad idea and such, how does bash and
> other shells write to STDIN when you press TAB to complete your
> writing?
I believe the process is writing to stdout in such cases, not stdin - i.e., it
reads the tab from stdin and writes to stdout.
>
> Just for my general knowledge :)
--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
------------------------------
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 6392
***************************************