[25146] in Perl-Users-Digest
Perl-Users Digest, Issue: 7395 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 12 00:05:21 2004
Date: Thu, 11 Nov 2004 21:05:05 -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 Thu, 11 Nov 2004 Volume: 10 Number: 7395
Today's topics:
Re: backreferneces in search pattern <see@sig.invalid>
Best way to pass module creator reference <Drago@mailinator.com>
Re: Best way to pass module creator reference <and11@rol.ru>
FAQ 5.17: How can I reliably rename a file? <comdog@panix.com>
Re: FAQ 9.16: How do I decode a CGI form? <sholden@flexal.cs.usyd.edu.au>
HELP: Where's the FAQ? (ft4bredn)
Re: HELP: Where's the FAQ? <see@sig.invalid>
Re: HELP: Where's the FAQ? <news@general-purpo.se>
Re: How do I get the application path <1usa@llenroc.ude.invalid>
LWP::UserAgent + HTTPS + threads ==> segmentation faul <craysmith@rcn.com>
Re: Need perl+java programmer <uri@stemsystems.com>
Re: PERL+CGI+PLUG-IN architecture <1usa@llenroc.ude.invalid>
Re: PERL+CGI+PLUG-IN architecture <emschwar@pobox.com>
Re: PERL+CGI+PLUG-IN architecture <noreply@gunnar.cc>
Re: PERL+CGI+PLUG-IN architecture <vilain@spamcop.net>
Re: PERL+CGI+PLUG-IN architecture <colo@megapolis.pl>
Re: PERL+CGI+PLUG-IN architecture <colo@megapolis.pl>
Re: why is pattern matching using '|' slower than 2 sep ctcgag@hotmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 11 Nov 2004 22:49:11 -0500
From: Bob Walton <see@sig.invalid>
Subject: Re: backreferneces in search pattern
Message-Id: <41943063_1@127.0.0.1>
Marek Stepanek wrote:
...
> I try to set up a Perl-Filter (for BBEdit on Macintosh). I want to match and
> print out all gifs needed for a rollover in an HTML-File. The filter should
Unless you control the layout of the HTML, you would be much better off
to parse your HTML using a HTML parser module (HTML::Parser, perhaps).
Correctly parsing HTML is much harder than it appears at first glance.
> match
>
> onmouseover="document.podium.src='../../pix/grafix/hili_podium.gif';
>
> but also beasts like the following :
>
> onmouseover="document.podium.src='../../pix/logos/theembassy1.gif';
> document.bios.src='../../pix/logos/theembassy2.gif';
> document.addresses.src='../../pix/logos/theembassy3.gif';
> document.events.src='../../pix/logos/theembassy4.gif';
> document.priwat.src='../../pix/logos/theembassy5.gif';
> document.yrpodium.src='../../pix/logos/theembassy6.gif';
> document.logo.src='../../pix/logos/hili_pilogo.gif'"
>
>
> the result should print from the above examples :
>
> '../../pix/grafix/hili_podium.gif',
> '../../pix/logos/theembassy1.gif',
> '../../pix/logos/theembassy2.gif',
> '../../pix/logos/theembassy3.gif',
> '../../pix/logos/theembassy4.gif',
> '../../pix/logos/theembassy5.gif',
> '../../pix/logos/theembassy6.gif',
> '../../pix/logos/hili_pilogo.gif',
>
>
> I am labouring since a long while already on this filter. Could somebody
> help me out ? I am beginner and want learn Perl very much.
>
> This filter here produces the following error :
>
>
> Modification of a read-only value attempted <> line 1.
>
>
> (mind line breaks from my email client)
>
>
> #!/usr/bin/perl -w
>
You are missing:
use strict;
use warnings;
Let Perl help you all it can. I see you did use the -w switch -- but
these days it is better to
use warnings;
because of the additional control over the warnings it affords. See
below for what I am talking about.
>
> while (<>) {
> ($1, $2, $3) =
-------^^--^^--^^
Those are your readonly variables that you are attempting to modify. See
perldoc perlvar
particularly the section about $<digits> . Note that the $1, $2, etc
variables are assigned by simply placing capturing sets of parentheses
in a regular expression. Judging from your next couple of lines of
code, you probably want:
my @results =
on this line, and then remove the "my @results=($1,$2,$3);" line.
> m!onmouseover="[^']+'([^']+)'(?:(?:(?:;\s+[^']+)'([^']+)')+)?(?:(?:[^']+)'([
> ^']+)')?"!g;
> my @results = ($1, $2, $3);
> foreach $i (0..$#results) {
> print "'", $i, "',\n";
> }
> }
>
> My question is not about the grep search pattern, but how to put the
> backreferences into an array to print it out.
>
> one other try gives :
>
> Use of uninitialized value in print <> line 2.
Note that that is a warning, and is not fatal. Your program should
continue to execute normally.
>
>
> #!/usr/bin/perl -w
>
> while (<>) {
> while (
> s!onmouseover="[^']+'([^']+)'(?:(?:(?:;\s+[^']+)'([^']+)')+)?(?:(?:[^']+)'(
> [^']+)')?"!!g ) {print "'", $1, "',\n"; print "'", $2, "',\n"; print "'",
> $3, "',\n";}
> }
The uninitialized value might have come from a capturing parentheses
pair that matched an empty string because it was inside the scope of a
"?" metacharacter and the "no occurrences" branch was taken. Prior to
the match, all the $1, $2 etc variables are set to undef, and are only
modified upon their corresponding set of parens actually being used in
the final match. This particular warning can be much less than totally
useful in a situation like this, which is why it can be suppressed in a
block with a "no warnings qw(uninitialized);" statement at its start.
The means something like:
while(<>){
no warnings qw(uninitialized);
s!onmouseover="...
}
But you can only do that if you
use warnings;
rather than the -w switch.
> marek
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Thu, 11 Nov 2004 19:04:34 -0600
From: Drago <Drago@mailinator.com>
Subject: Best way to pass module creator reference
Message-Id: <n3Ukd.2290$Vl5.655@fe25.usenetserver.com>
I have a module which I would like to be able to create instances of a
class it knows nothing about. Is there a neat way short of an anonymous
subroutine, like this example:
use Foo;
use Bar;
# this works, but seems overly verbose
Bar->new(sub { Foo->new(@_) } );
I note that
$c = \&Foo;
print ref($c); # says CODE
but within my module, one cannot then say
$c->new(...);
So I am not sure what \&Foo is giving me (i.e. a code reference to
what?). So is there a better way than the way I did it in the first example?
------------------------------
Date: Fri, 12 Nov 2004 04:25:19 +0000
From: Andrew Tkachenko <and11@rol.ru>
Subject: Re: Best way to pass module creator reference
Message-Id: <cn13im$6jo$1@news.rol.ru>
use Foo;
sub make_obj {
my $class = shift;
return $class->new(@_);
}
my $foo = make_obj("Foo", arg1 =>12, arg2 =>13)'
Probably this is what you looking for.
Regards, Andrew
Drago wrote on 12 Ноябрь 2004 01:04:
> I have a module which I would like to be able to create instances of a
> class it knows nothing about. Is there a neat way short of an anonymous
> subroutine, like this example:
>
> use Foo;
> use Bar;
> # this works, but seems overly verbose
> Bar->new(sub { Foo->new(@_) } );
>
> I note that
>
> $c = \&Foo;
> print ref($c); # says CODE
>
> but within my module, one cannot then say
>
> $c->new(...);
>
> So I am not sure what \&Foo is giving me (i.e. a code reference to
> what?). So is there a better way than the way I did it in the first
example?
--
Andrew
------------------------------
Date: Fri, 12 Nov 2004 05:03:06 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 5.17: How can I reliably rename a file?
Message-Id: <cn1g6a$4re$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
5.17: How can I reliably rename a file?
If your operating system supports a proper mv(1) utility or its
functional equivalent, this works:
rename($old, $new) or system("mv", $old, $new);
It may be more portable to use the File::Copy module instead. You just
copy to the new file to the new name (checking return values), then
delete the old one. This isn't really the same semantically as a
rename(), which preserves meta-information like permissions, timestamps,
inode info, etc.
Newer versions of File::Copy export a move() function.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: 11 Nov 2004 23:40:24 GMT
From: Sam Holden <sholden@flexal.cs.usyd.edu.au>
Subject: Re: FAQ 9.16: How do I decode a CGI form?
Message-Id: <slrncp7u38.j6h.sholden@flexal.cs.usyd.edu.au>
On Thu, 11 Nov 2004 19:26:15 +0000, Brian McCauley <nobull@mail.com> wrote:
>
>
> brian d foy wrote:
>
>> In article <2vgv25F2lgk92U1@uni-berlin.de>, Gunnar Hjalmarsson
>> <noreply@gunnar.cc> wrote:
>>
>>
[snip perlfaq on CGI]
>>>
>>>That diatribe is unprofessional, adversely affects the credibility of
>>>this FAQ entry, and should better be dropped. The above suggestion would
>>>be a sufficient replacement.
>>
>>
>> I don't think it's unprofessional (I didn't write it).
>
> I concur with Gunnar about this rant adversely affecting credibility.
> (Personal winge: I don't like the use of the word 'unprofessional'. A
> professional is, by definition, someone getting paid to work on
> something. The implication of using 'unprofessional' in this way that
> work for which people is paid is necessaritly of a higher quality than
> work that is given freely is anathma to me).
Pick a dictionary and read the entry for professional, assuming the
dictionary isn't complete garbage you'll see there is more than one
definition. One of the other ones is being used in that sentence.
--
Sam Holden
------------------------------
Date: Fri, 12 Nov 2004 01:49:10 GMT
From: none@anytime.net (ft4bredn)
Subject: HELP: Where's the FAQ?
Message-Id: <qEUkd.72$Hn.32@lakeread06>
Is the FAQ regularly posted? How can I get it?
Thanks,
ft4bredn
----------------------------------------------
Posted with NewsLeecher v1.0 beta 26
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------
------------------------------
Date: Thu, 11 Nov 2004 22:19:37 -0500
From: Bob Walton <see@sig.invalid>
Subject: Re: HELP: Where's the FAQ?
Message-Id: <41942974$1_5@127.0.0.1>
ft4bredn wrote:
> Is the FAQ regularly posted? How can I get it?
Well, let's see. At a quick glance it looks like pieces of it are
posted here once every six hours. Yep, looks pretty regular. Did you
notice that when you looked at this newsgroup?
How can you get it? Well, it just took me less than ten seconds to type
"Perl FAQ" into Google and click the "I'm feeling lucky" button which
displayed it (an old version, alas, and apparently not working too well
at the moment). You can also look at http://perlfaq.cpan.org .
You can also look right on your hard drive. Try:
perldoc perlfaq
at a command prompt.
...
> ft4bredn
...
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: 11 Nov 2004 21:33:17 -0600
From: David Kroeber <news@general-purpo.se>
Subject: Re: HELP: Where's the FAQ?
Message-Id: <slrncp8bd5.3v1.news@bonn.de.eu.taffy.nl>
* ft4bredn:
> Is the FAQ regularly posted? How can I get it?
see http://groups.google.de/groups?q=group%3Acomp.lang.perl.misc
(for older versions, too)
bye
//Dave
--
Ja, der typische "Ich tippe alles ein was mir ein paar Trottel aus dem
IRC sagen"-Newbie wird aber kein Solaris nutzen... ;)
-- Christoph Gebhardt in bjt
------------------------------
Date: 11 Nov 2004 23:17:10 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How do I get the application path
Message-Id: <Xns959EBA030D495asu1cornelledu@132.236.56.8>
Tom Tingdale <tom.tingdale@sbcglobal.net> wrote in
news:isq7p0t5vh5b4mpgv78em2qe490if72muo@4ax.com:
> I have a Win32 program that I want to make portable. I have converted
> my perl program into an executale. How can I get the absolute path to
> my executable application?
perldoc -q path
You are expected to check the FAQ list before posting.
If you have not already done so, I recommend reading the posting guidelines
for comp.lang.perl.misc. They are posted here regularly.
Sinan
------------------------------
Date: Thu, 11 Nov 2004 20:57:16 -0500
From: "Ray Smith" <craysmith@rcn.com>
Subject: LWP::UserAgent + HTTPS + threads ==> segmentation fault
Message-Id: <1uidnXuuQ9HlhQncRVn-2g@rcn.net>
Folks,
We have a problem using LWP::UserAgent, https, and threads.
When we do we get a segmentation error.
perl lwp_threads.pl <https://www.yahoo.com>
produces a Segmentation fault
while
perl lwp_threads.pl <http://www.yahoo.com>
does not.
Attached is the perl script.
Another question - does anybody outthere have examples of LWP, using the
callback function coupled with threads?
All suggestions are greatly appreciated.
Ray Smith (raysmith@alum.mit.edu <mailto:raysmith@alum.mit.edu>)
begin 666 lwp_threads.pl
M(R!T:')E861S7W1E<W0N<&P@(" @(" @,3 M3F]V+3(P,#0@(&-R<RP@0W)E
M871E#0HC(%-I;7!L92!T:')E861S('1E<W0-"B,-"G5S92!S=')I8W0[#0IU
M<V4@=&AR96%D<SL-"G5S92!,5U [#0H-"FUY("1U<FD[#0II9B H0$%21U8@
M/B P*2!9V5N="T^;F5W*"D[#0H-"FEF("AD969I;F5D("1U<FDI('L-"B @
M("!P<FEN=" B=7)I.B D=7)I7&XB.PT*(" @(&UY("1R(#T@)'5A+3YG970H
M)'5R:2D[#0H@(" @:68@*&YO=" D<BT^:7-?<W5C8V5S<R@I*2![#0H@(" @
M(" @('!R:6YT(")'150@97)R;W(@;VX@/"1U<FD^+BXN7&XB#0H@(" @(" @
M(" @+B D<BT^97)R;W)?87-?2%1-3"@I("X@(EQN(CL-"B @(" @(" @97AI
M="@Q*3L-"B @("!]#0I]#0H-"FUY("1T(#T@=&AR96%D<RT^;F5W*%PF=&AR
M96%D961297%U97-T5&AR96%D*0T*("!O<B!D:64@(D-A;B=T(&-R96%T92!T
M:')E861<;B([#0H-"G!R:6YT(")*;VEN:6YG('1H<F5A9%QN(CL-"FUY($!R
M970@/2 D="T^:F]I;B@I.PT*<')I;G0@(E1H<F5A9"!R971U<FYE9"! <F5T
M7&XB.PT*97AI="@P*3L-"@T*(R!!8W1U86P@5&AR96%D(&9U;F-T:6]N#0IS
M=6(@=&AR96%D961297%U97-T5&AR96%D('L-"B @("!P<FEN=" B26YS:61E
M('1H<F5A9&5D4F5Q=65S=%1H<F5A9%QN(CL-"B @("!R971U<FX@(D$@;&ES
1="!O9B!W;W)D<R([#0I]#0H`
`
end
------------------------------
Date: Fri, 12 Nov 2004 00:23:50 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Need perl+java programmer
Message-Id: <x7fz3fncdn.fsf@mail.sysarch.com>
>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
JB> Laura wrote:
>> How did you ever get your Perl patform embedded in Java? What kind of
>> a crazy scheme was that? I would recommend hiring a Java and a Perl
>> programmer for this job because Perl is a left-brain language while
>> Java is right-brain. You are not likely to find someone actively at
>> the top of their abilities in both languages.
JB> Odd. I try to be that :-)
she is amazed when anyone can be at the top in any language, given her
skill set.
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: 11 Nov 2004 23:15:32 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: PERL+CGI+PLUG-IN architecture
Message-Id: <Xns959EB9BC99CBDasu1cornelledu@132.236.56.8>
Colombo <colo@megapolis.pl> wrote in news:cn0r4a$rlu$1@achot.icm.edu.pl:
> Eric Schwartz wrote:
>> I understand English is probably not your first language, but I must
>> confess I have no idea what you mean by "plug-in architecture". For
>> writing CGI in Perl, start with the documentation for CGI.pm and see
>> how far that gets you. If you have questions about writing CGI
>> programs in general, ask around in comp.infosystems.www.authoring.cgi.
...
> You don't know what are plugins?
Eric knows what plugins are and I do but neither of us can see the
connection between CGI and plugins. Are you talking about browser plugins
or something else? If it is something else, I am afraid it is not clear
exactly what it is that you are talking about.
> I have to write a program which will load a plugin e.g. written by some
> else, and will use it.
Do you mean a library? If so, see
perldoc perlmod
perldoc perlmodlib
and
perldoc -q CPAN
> In windows programing I would use dll libraries but afaik there is
> nothing like that in perl.
Well, there is Dynaloader. But I still don't see the connection between
plugins and CGI.
> So I ask if anyone knows how to make this kind of programs.
You will need to exapnd on what you mean by "this kind of".
> Yes english isn't my first language, but is it so big problem?
In this case, it seems to be. But it may just be the fact that you do not
know the correct name for what you are looking for.
Sinan,
------------------------------
Date: Thu, 11 Nov 2004 16:18:50 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: PERL+CGI+PLUG-IN architecture
Message-Id: <etoy8h89dph.fsf@wilson.emschwar>
Colombo <colo@megapolis.pl> writes:
> You don't know what are plugins?
No, I didn't know what you meant by 'plug-in architecture'. You could
have meant writing CGI programs as plugins to someone else's code, or
writing plugins for existing CGI programs that have some sort of
plugin architecture.
> I have to write a program which will load a plugin e.g. written by some
> else, and will use it. In windows programing I would use dll libraries
> but afaik there is nothing like that in perl.
Yes there is; modules. See 'perldoc perlmod' for more information on
modules in Perl.
> So I ask if anyone knows how to make this kind of programs.
That wasn't clear to me from your originaly question, which is why I
asked. Read up on modules; they pretty much solve the kind of problem
you have.
> Yes english isn't my first language, but is it so big problem?
I only suggested that as a possible explanation for the ambiguity in
your original query.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Fri, 12 Nov 2004 00:19:23 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: PERL+CGI+PLUG-IN architecture
Message-Id: <2viacvF2ksiltU1@uni-berlin.de>
Colombo wrote:
> I'm looking for any information (or example programs) about writing
> programs in perl (cgi)
http://cgi.resourceindex.com/Documentation/CGI_Tutorials/
> in plug-in architecture.
Based on what you said in your other message, I suppose you are talking
about libraries or modules. As far as Perl is concerned, have a look at:
http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlmod.html
http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlmodlib.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 11 Nov 2004 15:28:52 -0800
From: "Michael Vilain <vilain@spamcop.net>"
Subject: Re: PERL+CGI+PLUG-IN architecture
Message-Id: <vilain-FC4F8B.15285211112004@news.giganews.com>
In article <cn0r4a$rlu$1@achot.icm.edu.pl>, Colombo <colo@megapolis.pl>
wrote:
> Eric Schwartz wrote:
> > I understand English is probably not your first language, but I must
> > confess I have no idea what you mean by "plug-in architecture". For
> > writing CGI in Perl, start with the documentation for CGI.pm and see
> > how far that gets you. If you have questions about writing CGI
> > programs in general, ask around in comp.infosystems.www.authoring.cgi.
> >
> > -=Eric
>
> You don't know what are plugins?
> I have to write a program which will load a plugin e.g. written by some
> else, and will use it. In windows programing I would use dll libraries
> but afaik there is nothing like that in perl. So I ask if anyone knows
> how to make this kind of programs.
> Yes english isn't my first language, but is it so big problem?
>
> Colombo
AFAIK, perl's CGI.pm doesn't have a "plugin" architecture, so that's
probably why you didn't find any "hits". Perl itself has a vast library
of modules (http://www.cpan.org) and there are documented ways of
writing perl modules.
perldoc perlmod
There are also lots of books out there on how to write perl code. I'm
sure you can find one that works for you in whatever language you're
comfortable with.
What business problem are you trying to solve that makes you think you
need to use perl's CGI with a plug-in architecture? As a last resort,
you could always write your own module with your own architecture, but
why re-invent the wheel?
--
DeeDee, don't press that button! DeeDee! NO! Dee...
------------------------------
Date: Fri, 12 Nov 2004 02:01:13 +0000
From: Colombo <colo@megapolis.pl>
Subject: Re: PERL+CGI+PLUG-IN architecture
Message-Id: <cn11pp$m0$1@achot.icm.edu.pl>
"Michael Vilain <vilain@spamcop.net>" wrote:
> In article <cn0r4a$rlu$1@achot.icm.edu.pl>, Colombo <colo@megapolis.pl>
> wrote:
>
>
>>Eric Schwartz wrote:
>>
>>>I understand English is probably not your first language, but I must
>>>confess I have no idea what you mean by "plug-in architecture". For
>>>writing CGI in Perl, start with the documentation for CGI.pm and see
>>>how far that gets you. If you have questions about writing CGI
>>>programs in general, ask around in comp.infosystems.www.authoring.cgi.
>>>
>>>-=Eric
>>
>>You don't know what are plugins?
>>I have to write a program which will load a plugin e.g. written by some
>>else, and will use it. In windows programing I would use dll libraries
>>but afaik there is nothing like that in perl. So I ask if anyone knows
>>how to make this kind of programs.
>>Yes english isn't my first language, but is it so big problem?
>>
>>Colombo
>
>
> AFAIK, perl's CGI.pm doesn't have a "plugin" architecture, so that's
> probably why you didn't find any "hits". Perl itself has a vast library
> of modules (http://www.cpan.org) and there are documented ways of
> writing perl modules.
>
> perldoc perlmod
>
> There are also lots of books out there on how to write perl code. I'm
> sure you can find one that works for you in whatever language you're
> comfortable with.
>
> What business problem are you trying to solve that makes you think you
> need to use perl's CGI with a plug-in architecture? As a last resort,
> you could always write your own module with your own architecture, but
> why re-invent the wheel?
>
I have to build a program that helps in server administration, sth. like
webmin. The main program will manage plugins, and each plugin will
administrate one type of server (e.g. apache, sendmail,...). I must use
plug-in architecture because this is what my teacher want me to do.
Firstly I was told to use Mason modul by when my teacher heard about it
he forbid me using it.
Thanks for perlmod. I overlooked this when I was fighting with Mason.
Colombo
------------------------------
Date: Fri, 12 Nov 2004 02:09:27 +0000
From: Colombo <colo@megapolis.pl>
Subject: Re: PERL+CGI+PLUG-IN architecture
Message-Id: <cn1297$128$1@achot.icm.edu.pl>
Eric Schwartz wrote:
> Colombo <colo@megapolis.pl> writes:
>
>>You don't know what are plugins?
>
>
> No, I didn't know what you meant by 'plug-in architecture'. You could
> have meant writing CGI programs as plugins to someone else's code, or
> writing plugins for existing CGI programs that have some sort of
> plugin architecture.
>
>
>>I have to write a program which will load a plugin e.g. written by some
>>else, and will use it. In windows programing I would use dll libraries
>>but afaik there is nothing like that in perl.
>
>
> Yes there is; modules. See 'perldoc perlmod' for more information on
> modules in Perl.
>
>
>>So I ask if anyone knows how to make this kind of programs.
>
>
> That wasn't clear to me from your originaly question, which is why I
> asked. Read up on modules; they pretty much solve the kind of problem
> you have.
>
>
>>Yes english isn't my first language, but is it so big problem?
>
>
> I only suggested that as a possible explanation for the ambiguity in
> your original query.
>
> -=Eric
Thanks for help. I'll try to use this perlmod. I wrote more about my
problem in answer to other post. Maybe I should sorry for my english
earlier but we are on the net and most of people here don't know eglish
perfectly. I'm trying to write this program for so long that I am in it
and didn't think that anyone else could not know what I mean. Sorry.
Colombo
------------------------------
Date: 11 Nov 2004 23:12:40 GMT
From: ctcgag@hotmail.com
Subject: Re: why is pattern matching using '|' slower than 2 separate ones?
Message-Id: <20041111181240.368$ui@newsreader.com>
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
> Dave
> <daveandniki@ntlworld.com>], who wrote in article
> <3r4kd.189$Av5.115@newsfe4-gui.ntli.net>:
>
> $a = 'ZZZZZZZZZ'; # Or some such
>
> > > $a=1 if $z=~/xxxxx|yyyyy/;
> > > # $a=1 if $z=~/xxxxx/ or $z=~/yyyyy/;
>
> > For the answer to this and more (if you are interested) have a look at
> > Mastering Regular Expressions by Jeremy Friedl
>
> Did not see the newer edition. Does it describe the operation of REx
> optimizer?
>
> > The short answer is that the behaviour is entirely expected. The first
> > version caused the Regex engine to do lots of switching at each
> > position in the string to swap between looking for one then the other.
> > It also hinders the engine from doing certain optimisations which are
> > easy with the simple literal string.
>
> This has little relation to what actually happens. The REx engine
> proper is not even entered with these patterns. It is the optimizer
> who rejects the match. And with the first version it tries to find
> 'x' or 'y' inside the string - which is much slower that looking for
> 'x' at each 5th position - as the second version does.
>
> IMO, it is the "each 5th position" which helps - not switching between
> two possibilities.
>
> Run with use re 'debugcolor' for details,
It looks like the optimizer is not doing the rejections on the first
version, it is only doing rejections on the 2nd versions. The 1st versions
goes through all the gory details of the regex engine, including a bunch of
Eval scopes.
(5.8.0)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
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 7395
***************************************