[28808] in Perl-Users-Digest
Perl-Users Digest, Issue: 52 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 19 14:06:01 2007
Date: Fri, 19 Jan 2007 11:05:08 -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 Fri, 19 Jan 2007 Volume: 11 Number: 52
Today's topics:
error U1073: don't know how to make '/usr/lib/perl5/5.8 <ranrodrig@gmail.com>
Re: error U1073: don't know how to make '/usr/lib/perl5 <purlgurl@purlgurl.net>
Re: FAQ 3.22 How can I get "#!perl" to work on [MS-DOS, <rvtol+news@isolution.nl>
Re: help problemes cgi and GD::Text <simon.andrews@bbsrc.ac.uk>
Re: How to decode javascript encodeURI / encodeURICompo <Cloink_Friggson@ntlworld.com>
Re: How to decode javascript encodeURI / encodeURICompo <rvtol+news@isolution.nl>
Re: How to decode javascript encodeURI / encodeURICompo <jurgenex@hotmail.com>
Re: I/O open() <bik.mido@tiscalinet.it>
Re: I/O open() <novafyre@hotmail.com>
Re: I/O open() <spamtrap@dot-app.org>
LibXML validation using an external DTD through a proxy <jeffhughes1@yahoo.com>
Re: LibXML validation using an external DTD through a p <glex_no-spam@qwest-spam-no.invalid>
Re: need help with the tr and s/// <novafyre@hotmail.com>
Re: need help with the tr and s/// anno4000@radom.zrz.tu-berlin.de
Re: Perl CGI or Something Else CGI? <nobody@nowhere.com>
Re: Perl CGI or Something Else CGI? <wahab-mail@gmx.de>
Re: Perl CGI or Something Else CGI? <purlgurl@purlgurl.net>
Re: Perl CGI or Something Else CGI? <rg.bacs@gmail.com>
Re: Perl CGI or Something Else CGI? usenet@DavidFilmer.com
Re: Perl CGI or Something Else CGI? <spamtrap@dot-app.org>
Re: Regexp for parsing windows filepath on Unix <rvtol+news@isolution.nl>
Re: Regexp for parsing windows filepath on Unix <mritty@gmail.com>
Re: Regexp for parsing windows filepath on Unix <john@castleamber.com>
require vs. allow package reference eponymousalias@yahoo.com
Re: require vs. allow package reference <mritty@gmail.com>
Re: SOAP::Lite & Web Services not ready for prime time? <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Unable to find form <rvtol+news@isolution.nl>
Re: Undefined subroutine &main <glex_no-spam@qwest-spam-no.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Jan 2007 08:18:25 -0800
From: "ranrodrig" <ranrodrig@gmail.com>
Subject: error U1073: don't know how to make '/usr/lib/perl5/5.8/cygwin/Config.pm', on win2k, how can I solve it?
Message-Id: <1169223504.587985.211010@v45g2000cwv.googlegroups.com>
I'm trying to compile some perl pgms on my windows2k Sp3 so I installed
the following in order to do it:
ActivePerl 5.8.8.819
Cygwin 2.510.2.2 (without Perl)
Parse::Binary module 0.10
When I run:
perl Makefile.pl, all is OK
when I run:
nmake, I got the error described previously (U1073).
If I edit the Makefile, I found the following variables:
LDDLFLAGS = -s -L/usr/local/lib
LDFLAGS = -s -L/usr/local/lib
LIBC = /usr/lib/libc.a
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = cygwin
OSVERS = 1.5.18\(0.13242\)
RANLIB = :
SITELIBEXP = /usr/lib/perl5/site_perl/5.8
SITEARCHEXP = /usr/lib/perl5/site_perl/5.8/cygwin
SO = dll
EXE_EXT = .exe
FULL_AR = /usr/bin/ar
VENDORARCHEXP = /usr/lib/perl5/vendor_perl/5.8/cygwin
VENDORLIBEXP = /usr/lib/perl5/vendor_perl/5.8
So I think that this error message is related to these variables, but
as I'm a novice on Perl I don't know what to modify on them in order to
look for Perl on C:\Perl.
My question for you Folks would be: Do you know how to modify these env
variables that look like Linux ones, or if you have experienced this,
can you tell how did you solve it?.
BR & TIA for your comments & help.
Raul.
------------------------------
Date: Fri, 19 Jan 2007 08:47:03 -0800
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: error U1073: don't know how to make '/usr/lib/perl5/5.8/cygwin/Config.pm', on win2k, how can I solve it?
Message-Id: <45B0F607.5090801@purlgurl.net>
ranrodrig wrote:
(snipped)
> I'm trying to compile some perl pgms on my windows2k Sp3
> ActivePerl 5.8.8.819
> perl Makefile.pl, all is OK
> nmake, I got the error described previously (U1073).
> If I edit the Makefile, I found the following variables:
> SITELIBEXP = /usr/lib/perl5/site_perl/5.8
> SITEARCHEXP = /usr/lib/perl5/site_perl/5.8/cygwin
> look for Perl on C:\Perl.
> My question for you Folks would be: Do you know how to modify these env
> variables that look like Linux ones, or if you have experienced this,
> can you tell how did you solve it?.
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/lib/Config.html
Purl Gurl
------------------------------
Date: Fri, 19 Jan 2007 16:07:04 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: FAQ 3.22 How can I get "#!perl" to work on [MS-DOS,NT,...]?
Message-Id: <eoqqfi.1dc.1@news.isolution.nl>
trudge@gmail.com schreef:
> A few years ago I hit on the idea of installing Perl under /usr/bin on
> my Windows machine so I don't have to change anything when I upload
> scripts. The shebang line is still #! /usr/bin/perl
The ActiveState Windows perl installation defines "*.pl" as executable.
So Windows' perl doesn't need nor use the path portion of the shebang,
it only checks for 'perl' and uses any flags.
So feel free to use
#!/usr/bin/perl -T
as the shebang, even when the perl executable is not in that path on
your system.
On some *ix systems, /usr/bin/perl is a hardlink to /usr/local/bin/perl.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 19 Jan 2007 16:28:37 +0000
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: help problemes cgi and GD::Text
Message-Id: <eoqrji$5bf$1@south.jnrs.ja.net>
john.swilting wrote:
> How to use GD::Text
>
> The documentation says
>
> my $gd_text = GD::Text->new(
> text => 'Some text',
> font => 'funny.ttf',
> ptsize => 14,
> );
> And I have
>
>
> # create a new
>
> my $im = new GD::Image(100,100);
[snip]
> print $q->header( -type => "image/png", -expires => "-1d");
> binmode STDOUT;
> print $im->png
>
> How to make
> So that both work together
I have to say that looking at the POD for GD::Text it's not at all
obvious! However if you look in the demos directory of the GD::Text
module there is a nice example of how to do it
http://search.cpan.org/src/MVERB/GDTextUtil-0.86/demo/GDWrap.pl
Basically
my $gd = GD::Image->new(400,240);
my $wp = GD::Text::Wrap->new($gd,
width => 180,
line_space => 4,
color => $black,
text => $text,
);
$gd->rectangle($wp->get_bounds(10,10), $blue);
$wp->draw(10,10);
binmode STDOUT ;
print STDOUT $gd->png();
------------------------------
Date: 19 Jan 2007 06:21:46 -0800
From: "Cloink" <Cloink_Friggson@ntlworld.com>
Subject: Re: How to decode javascript encodeURI / encodeURIComponent ?
Message-Id: <1169216505.936272.182460@51g2000cwl.googlegroups.com>
Thanks - I don't think that copes though, the regexp mentioned in the
doc'n is the same regexp I'm already using.
I have emailed the author of the package though.
Thanks again.
Michele Dondi wrote:
> On 18 Jan 2007 05:33:44 -0800, "Cloink" <Cloink_Friggson@ntlworld.com>
> wrote:
>
> >I can't believe no-one's already done it, but I can't find any exact
> >mention of it on the tinterweb.
>
> What is the tinterweb?!?
>
> >So come on - I need a Perl function to decode a URL that has been
> >encoded with a javascript encodeURI() or encodeURIComponent() call.
>
> URI::Escape would seem to be a good starting point...
>
>
> 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: Fri, 19 Jan 2007 16:14:56 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: How to decode javascript encodeURI / encodeURIComponent ?
Message-Id: <eoqr2e.rk.1@news.isolution.nl>
Cloink schreef:
> Look Brian clever clogs McCauley
*ploink*
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 19 Jan 2007 15:29:47 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to decode javascript encodeURI / encodeURIComponent ?
Message-Id: <Lt5sh.2$2n.1@trndny06>
[Unfortunately you choose a poor answering style, therefore I have to guess
what you are referring to]
Cloink wrote:
> Look Brian clever clogs McCauley, I spent hours trawling the web,
Well, that's your problem. Why didn't you look at the readily available
documentation on your own harddrive first?
> don't come your "You haven't tried hard enough," sneering down your
> nose at me. The FAQ. THE faq. Which one?
See below
> Brian McCauley wrote:
>> On Jan 18, 1:33 pm, "Cloink" <Cloink_Frigg...@ntlworld.com> wrote:
>>> Simply: How ?
>>
>> This is (almost) FAQ: "How do I decode or create those %-encodings on
>> the web?"
Maybe the one to which Brian quoted the _exact_ title?
The one that pops up if you query the FAQ for any of the words 'decode' or
'create' or 'encoding'?
jue
------------------------------
Date: Fri, 19 Jan 2007 18:07:30 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: I/O open()
Message-Id: <0ku1r2l5af9jae0o66kg4guk52h6ph0a0c@4ax.com>
On Fri, 19 Jan 2007 06:51:06 -0700, Mark Donovan
<novafyre@hotmail.com> wrote:
>Simply 'print @INC;' to see your settings.
possibly
perl -le 'print for @INC'
for maximum clarity...
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: Fri, 19 Jan 2007 10:48:20 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: I/O open()
Message-Id: <C1D65274.95D3%novafyre@hotmail.com>
Oh, an *amazing* improvement. Thank you so much, Dondi! I'm certain your
impressive insight will help Mike with his software installation problem in
ways none of us can possibly imagine. Thank you, thank you, thank you!
On 1/19/07 10:07, "Michele Dondi" <bik.mido@tiscalinet.it> wrote:
>
> for maximum clarity...
------------------------------
Date: Fri, 19 Jan 2007 13:09:51 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: I/O open()
Message-Id: <m264b228i8.fsf@Sherm-Pendleys-Computer.local>
"mmccaws2" <mmccaws@comcast.net> writes:
> Sherm Pendley wrote:
>> "mmccaws2" <mmccaws@comcast.net> writes:
>>
>> > CPAN.pm: Going to build C/CR/CREIN/Net-DNS-0.45.tar.gz
>>
>> Looks like the CPAN mirror you're using is way out of date. Chris Reinhardt
>> hasn't been the maintainer for Net::DNS since 2004. The current version is
>> 0.59, and maintained by Olaf Kolkman. Running install Net::DNS gives me this:
>>
>> CPAN.pm: Going to build O/OL/OLAF/Net-DNS-0.59.tar.gz
>>
>> I'm running Mac OS X 10.4 with Perl 5.8.6, same as you. I suggest running
>> 'o conf init' in the CPAN shell and selecting a different mirror or two.
>
> So far each package I've installed related to this required force
> install.
That's certainly *not* a good sign. The 0.59 version of Net::DNS, and *all*
of its dependencies, built, tested, and installed without problems for me.
> I suspect that there is something wrong done early on when I
> was having difficulties.
Like I said - try the 'o conf init' command from within the CPAN shell. That
will rerun the initial Q&A session. When you get to the part about selecting
one or more CPAN mirrors, select something other than the one you're using
now - I suspect that it is *way* out of date.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: 19 Jan 2007 08:31:56 -0800
From: "jhughe90" <jeffhughes1@yahoo.com>
Subject: LibXML validation using an external DTD through a proxy?
Message-Id: <1169224315.975277.84900@51g2000cwl.googlegroups.com>
I'm trying to validate an XML doc using LibXML using an external DTD.
The problem is the HTTP request needs to go through a proxy, and LibXML
doesn't seem to provide any support for this. It doesn't support an
LWP UserAgent via any means nor does it process HTTPx_PROXY ENV
variables. Anyone have any ideas on how to get this to work?
Thanks,
Jeff
------------------------------
Date: Fri, 19 Jan 2007 10:59:55 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: LibXML validation using an external DTD through a proxy?
Message-Id: <45b0f879$0$506$815e3792@news.qwest.net>
jhughe90 wrote:
> I'm trying to validate an XML doc using LibXML using an external DTD.
> The problem is the HTTP request needs to go through a proxy, and LibXML
> doesn't seem to provide any support for this. It doesn't support an
> LWP UserAgent via any means nor does it process HTTPx_PROXY ENV
> variables. Anyone have any ideas on how to get this to work?
Using my favorite Internet search engine, I found the following, which
might help: http://use.perl.org/~perigrin/journal/31137
------------------------------
Date: Fri, 19 Jan 2007 07:21:26 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: need help with the tr and s///
Message-Id: <C1D621F6.95AA%novafyre@hotmail.com>
Dondi,
It's unfortunate that your e-mail address doesn't work.
Delivery to the following recipient failed permanently:
bik.mido@tiscalinet.it
Technical details of permanent failure:
PERM_FAILURE: SMTP Error (state 9): 552 RCPT TO:<bik.mido@tiscalinet.it>
Mailbox disk quota exceeded
I take exception to your assertion. You are simply wrong. I, not you, decide
what steps are necessary to illustrate the method I suggest. If you think
you have a better solution, fine, post it. Your only contribution so far is
this obfuscated code which illustrates how badly perl can be abused.
$s2 =~ s/(.*?)0*\z/$1 . do{($s1 =~ m|(0*)\z|g)[0]}/e;
It makes nothing more clear. I don't like it. You said you don't like it.
You may have a solution. I haven't seen it.
You seem to believe I have used some unnecessary perl statements in my
answer. You said so. I agreed and I told you why. The perldocs have lots of
examples of code that is not optimal. Why won't you accept that I might want
to include steps that show something I think is important.
I don't need your instruction on how to answer questions. You have yet to
offer anything constructive or useful information to zim who asked the
original question.
The four statements I posted allow someone to insert print statement that
show the steps I chose to illustrate a method. For some reason, you felt
your method is more clear than mine. Fine! I agreed, my method is not
optimal, I said it. If you have a better method, post it. Instead, you
persist in trying to push your solution on me. But your comments don't
instruct me, I already know my code was not optimal. I explained that and
still you try to tell me how I must answer a question to suit your
preferences.
The reason I posted my reply over your quoted text is that I did not intend
for you to reply. You might have taken the hint. In any case, whether I post
above or below quoted material is not your concern. You certainly saw that
my original post was below the quoted material. So you can assume I
understand when to use that style and you can further assume that when I
don't do it, I have a reason.
Frankly, I don't care if you're annoyed by someone who posts above quoted
material in certain circumstances. It's not your place to correct me. You
entirely miss the point of posting guidelines. The guidelines are not rules
for you to enforce. As I explained, the purpose of posting after quoted
material is to make it easier for others to follow an extended discussion. I
responded and agreed with you that my illustration was not optimal perl
code. I let you know that my intent was to illustrate a method. No follow-up
is required.
You are free to post an your improved solution if you have one. If it works
and it's not obfuscated abuse of perl code, you can be assured I'll let your
solution stand without trying to improve it with irrelevant commentary.
--
Regards,
Mark Donovan
------------------------------
Date: 19 Jan 2007 15:10:53 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: need help with the tr and s///
Message-Id: <51c5btF1jktv8U1@mid.dfncis.de>
Tad McClellan <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
[...]
> my $one_str = '1230000';
>
> (my $zeros = $one_str) =~ s/.*?(?=0+$)//; # strip all but trailing zeros
Why not a simple capture?
my ( $zeros) = $one_str =~ /(0*)$/;
Anno
------------------------------
Date: Sat, 20 Jan 2007 00:48:29 +1000
From: Gregory Toomey <nobody@nowhere.com>
Subject: Re: Perl CGI or Something Else CGI?
Message-Id: <1169218104.797147@kangaroo.ozonline.com.au>
Rg wrote:
> Hello everyone,
>
> I am writing drafts for an online system that must be accessible via
> Web and must make use of some DBMS (probably MySQL). I am planning on
> using Perl CGI, but I can't really make up my mind about that decision.
It depends on what you mean by fast and whether your web server can cope with the load.
Here are a few things I've tried
- use a C program to write out the http header,fork, and run Perl
- use cgilib.pl rather than cgi.pm
- use the mod_perl Apache module; your Perl program is always memory-resident
To give you an idea of speed, here are a couple of sites I wrote using Perl & mysql:
http://pchq.com.au (view the source, all extraneous whitespace is removed to speed page loading; try doing that in PHP!)
http://www.float.com.au/beta
gtoomey
------------------------------
Date: Fri, 19 Jan 2007 15:46:58 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Perl CGI or Something Else CGI?
Message-Id: <eoqlum$6rt$1@mlucom4.urz.uni-halle.de>
Rg wrote:
> So, here's the question: should I actually worry about starting up the
> Perl interpreter and then logging into the DBMS at the expense of
> efficiency? Does that really happen or Perl CGI works in some other way
> that I'm just missing here? And, finally, does it pay to use pure C CGI
> or PHP instead of Perl CGI?
You could use mod_perl (http://perl.apache.org/), which is
a (almost pure C) persistent perl process. Combine this
with HTML::Mason (http://www.masonbook.com/), so you could
put a
<%ONCE>
my $dbh = $dbh | open_database(.. ... ...);
...
</%ONCE>
at the bottom of each file dealing
with the data model
Regards
Mirco
------------------------------
Date: Fri, 19 Jan 2007 07:24:51 -0800
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: Perl CGI or Something Else CGI?
Message-Id: <45B0E2C3.2050208@purlgurl.net>
Gregory Toomey wrote:
> Rg wrote:
(snipped)
>> using Perl CGI, but I can't really make up my mind about that decision.
> - use cgilib.pl rather than cgi.pm
> - use the mod_perl Apache module; your Perl program is always....
An obscure note to add your good advice. Versions of CGI.pm prior
to 2.32 are not compatible with the mod_perl Apache module. There
are also reported issues with Perl version, CGI.pm and mod_perl
select combinations.
For all failure case examples, CGI.pm is the problem, not Perl
nor the mod_perl module.
Generally speaking, CGI.pm versions 2.32 and up will work with
Perl version 5.6 and up, and any version of the mod_perl module
which is system compatible.
Purl Gurl
------------------------------
Date: 19 Jan 2007 08:43:55 -0800
From: "Rg" <rg.bacs@gmail.com>
Subject: Re: Perl CGI or Something Else CGI?
Message-Id: <1169225035.373970.23260@s34g2000cwa.googlegroups.com>
Responses very much appreciated. Thanks!
On 19 jan, 13:24, Purl Gurl <purlg...@purlgurl.net> wrote:
> Gregory Toomey wrote:
> > Rg wrote:(snipped)
>
> >> using Perl CGI, but I can't really make up my mind about that decision.
> > - use cgilib.pl rather than cgi.pm
> > - use the mod_perl Apache module; your Perl program is always....An obscure note to add your good advice. Versions of CGI.pm prior
> to 2.32 are not compatible with the mod_perl Apache module. There
> are also reported issues with Perl version, CGI.pm and mod_perl
> select combinations.
>
> For all failure case examples, CGI.pm is the problem, not Perl
> nor the mod_perl module.
>
> Generally speaking, CGI.pm versions 2.32 and up will work with
> Perl version 5.6 and up, and any version of the mod_perl module
> which is system compatible.
>
> Purl Gurl
------------------------------
Date: 19 Jan 2007 09:42:26 -0800
From: usenet@DavidFilmer.com
Subject: Re: Perl CGI or Something Else CGI?
Message-Id: <1169228545.896488.12890@l53g2000cwa.googlegroups.com>
Rg wrote:
> It worries me that every page hit should have the
> Perl interpreter instantiated and then have it logged into the DBMS.
You are not unique - that has worried a lot of people.
> Instead, I'd like something that would stay memory-resident and already
> logged into the DBMS.
Then what you want is mod_perl. It does EXACTLY what you want,
including keeping the database connection(s) resident (it even
overloads the database disconnect() method with no-op, so even if you
TRY to disconnect you don't really do so).
Nearly any well-written Perl script will run without modification on a
mod_perl-enabled webserver. The criteria for "well-written" is not
very high - if your program compiles OK with the "use strict" pragma
then there's a very, very good possibility it is "well-written" enough
for mod_perl (see the docs for more specifics: http://perl.apache.org)
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Fri, 19 Jan 2007 12:43:54 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Perl CGI or Something Else CGI?
Message-Id: <m2ps9a29ph.fsf@Sherm-Pendleys-Computer.local>
"Rg" <rg.bacs@gmail.com> writes:
> The one fact that prevents me from starting to write Perl CGI right
> away is efficency. It worries me that every page hit should have the
> Perl interpreter instantiated and then have it logged into the DBMS.
That's certainly a valid concern, but it's nothing to do with Perl, it's
the definition of CGI in any language.
> Instead, I'd like something that would stay memory-resident and already
> logged into the DBMS.
A good solution, certainly - but that's not CGI.
> So, here's the question: should I actually worry about starting up the
> Perl interpreter and then logging into the DBMS at the expense of
> efficiency? Does that really happen or Perl CGI works in some other way
That's how CGI works in *any* language. CGI ("Common Gateway Interface)
defines how a web server passes data to a child process, and how the child
passes results back to the server.
> that I'm just missing here? And, finally, does it pay to use pure C CGI
> or PHP instead of Perl CGI?
A CGI in C would have some of the same issues; there would be process-
creation and DBMS connection overhead to be concerned with. Obviously,
there would not be the time spent compiling Perl code.
PHP is usually (but not always) run as an in-process server module. You
can run Perl as a server module also - have a look at mod_perl if you're
using Apache:
<http://perl.apache.org>
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Fri, 19 Jan 2007 16:36:13 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Regexp for parsing windows filepath on Unix
Message-Id: <eoqs81.1fo.1@news.isolution.nl>
Paul Lalli schreef:
> s{^.*\\}{}g;
Why the g-modifier?
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 19 Jan 2007 08:36:50 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Regexp for parsing windows filepath on Unix
Message-Id: <1169224610.519026.204300@38g2000cwa.googlegroups.com>
Dr.Ruud wrote:
> Paul Lalli schreef:
>
> > s{^.*\\}{}g;
>
> Why the g-modifier?
Uhm. Just to see if you were paying attention? ;-) You're right, my
mistake, that doesn't belong there. Thanks for catching it.
Paul Lalli
------------------------------
Date: 19 Jan 2007 17:53:50 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Regexp for parsing windows filepath on Unix
Message-Id: <Xns98BD7905746F6castleamber@130.133.1.4>
Mirco Wahab <wahab-mail@gmx.de> wrote:
> this would even work without explicit capturing to $1 ;-)
>
> my $path = 'C:\My Documents\My files\file1.doc';
> my ($doc) = $path=~ /[^\\]+$/g;
Yup, but I consider the g more confusing compared to the () :-D
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 19 Jan 2007 10:57:51 -0800
From: eponymousalias@yahoo.com
Subject: require vs. allow package reference
Message-Id: <1169233071.544018.312770@l53g2000cwa.googlegroups.com>
I have a question about how to structure conditional code.
I've got a Perl script I want to give to customers A, B, and C.
Customers A and B will run the script unmodified. Customer C
needs some special tweaks, but I don't want to contaminate the
standard script with customer-specific code. So I'd like to
build a package interface, and execute that package conditionally,
depending on whether or not it's installed at the customer site.
sub allow
{
my ($package) = @_;
# I'm not sure how to efficiently check if the package exists.
# Preferably, this check would not duplicate the work that
# require will do internally, but maybe that's not possible.
if ($package exists) { require $package; return 1; }
return 0;
}
my $package_foo_is_available = allow Foo;
...
if ($package_foo_is_available)
{
Foo::execute arguments ... ;
}
Essentially, I want require without its "die" semantics if the
package cannot be found; I'd rather return a value to the calling
program so it can adapt gracefully to local conditions.
Is there some standard pattern/implementation for this?
------------------------------
Date: 19 Jan 2007 11:04:44 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: require vs. allow package reference
Message-Id: <1169233484.340540.151590@38g2000cwa.googlegroups.com>
eponymousal...@yahoo.com wrote:
> I have a question about how to structure conditional code.
>
> I've got a Perl script I want to give to customers A, B, and C.
> Customers A and B will run the script unmodified. Customer C
> needs some special tweaks, but I don't want to contaminate the
> standard script with customer-specific code. So I'd like to
> build a package interface, and execute that package conditionally,
> depending on whether or not it's installed at the customer site.
>
> sub allow
> {
> my ($package) = @_;
> # I'm not sure how to efficiently check if the package exists.
> # Preferably, this check would not duplicate the work that
> # require will do internally, but maybe that's not possible.
> if ($package exists) { require $package; return 1; }
> return 0;
> }
>
> my $package_foo_is_available = allow Foo;
>
> ...
>
> if ($package_foo_is_available)
> {
> Foo::execute arguments ... ;
> }
>
> Essentially, I want require without its "die" semantics if the
> package cannot be found; I'd rather return a value to the calling
> program so it can adapt gracefully to local conditions.
>
> Is there some standard pattern/implementation for this?
Yes. You're going about it backwards, though. Rather than try to
duplicate require() without the die(), just use require, and if it
die()s, trap that die(). That's precisely what the eval() function is
for:
sub allow {
my $package = shift;
eval {
require $package;
}
if ($@) {
# 'require' died, $package not available
return;
} else {
# 'require succeeded, $package loaded.
return 1;
}
}
For more information, see:
perldoc -f eval
Hope this helps,
Paul Lalli
------------------------------
Date: Fri, 19 Jan 2007 18:58:55 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: SOAP::Lite & Web Services not ready for prime time?
Message-Id: <45b106e0$0$5109$ba4acef3@news.orange.fr>
Steve Leibel wrote:
> I've had occasion recently to need write both a SOAP client and a SOAP
> server in Perl. I found that SOAP::Lite doesn't seem to handle WSDL (web
> services definition language) very well; and it also has trouble with
> structured data such as hashes.
>
> Even though there's even an O'Reilly book on writing Web Services in
> Perl, there doesn't seem to be much serious real world activity in this
> area.
>
> Am I looking in the wrong places? Or are SOAP and Web Services not being
> implemented very much in Perl?
http://www.soaplite.com/ has some interesting information.
For what it's worth, I've written production code that calls SOAP
methods against some Java implemented SOAP services published using
WSDL: it worked but was a little fiddly and required the latest (at the
time) versions of SOAP::Lite before they were available on CPAN. YMMV.
What particular issues have you been having? Anything that could be
framed in a bug report?
Mark
------------------------------
Date: Fri, 19 Jan 2007 16:39:15 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Unable to find form
Message-Id: <eoqs82.1fo.1@news.isolution.nl>
Nospam schreef:
> #! usr/bin/perl
ITYM:
#!/usr/bin/perl
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 19 Jan 2007 10:18:02 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Undefined subroutine &main
Message-Id: <45b0eea7$0$709$815e3792@news.qwest.net>
Pet wrote:
> Hi,
>
> I am writing a perl script create a imap folder.
> I got the following error:
>
> Undefined subroutine &main:: called at
> /usr/local/lib/perl5/site_perl/5.8.8/IMAP/Admin.pm line 108.
>
> Does anyone seen this error before?
> What is a potential way to fix it?
perldoc perldiag
Undefined subroutine &%s called
(F) The subroutine indicated hasn't been defined, or if it was, it
has since been undefined.
Post a short example. Also, what version of IMAP::Admin are you using?
------------------------------
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 V11 Issue 52
*************************************