[25625] in Perl-Users-Digest
Perl-Users Digest, Issue: 7867 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 8 18:05:45 2005
Date: Tue, 8 Mar 2005 15:05:20 -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 Tue, 8 Mar 2005 Volume: 10 Number: 7867
Today's topics:
Re: cant display generated html in browser (perl script (Piet L.)
Re: doubt regarding Symbolic references <matternc@comcast.net>
find command (julia)
Re: find command <pilkowsk@informatik.uni-marburg.de>
Re: find command <jl_post@hotmail.com>
Re: find command <lawshouse.public@btconnect.com>
Re: find command <tadmc@augustmail.com>
How Perl Saved Planet Earth <dave@subcreations.com>
Re: How to view error messages within a function <tadmc@augustmail.com>
Re: include external perl program <jgibson@mail.arc.nasa.gov>
Re: include external perl program mazzawi@gmail.com
Re: include external perl program <jgibson@mail.arc.nasa.gov>
infinite loop (newbie) <usaims@yahoo.com>
Re: infinite loop (newbie) <noreply@gunnar.cc>
Re: infinite loop (newbie) <wyzelli@yahoo.com>
Re: infinite loop (newbie) <noreply@gunnar.cc>
Re: infinite loop (newbie) <pilkowsk@informatik.uni-marburg.de>
Re: infinite loop (newbie) <usaims@yahoo.com>
perl 5.8.5 segfaults on patternmatch <pilsl@goldfisch.at>
perlce (perl and perlide) <arcadefx@msn.com>
Praesideo: Latin for 'to watch over' <invinity@nvinity.net>
Re: Praesideo: Latin for 'to watch over' <postmaster@castleamber.com>
Re: Q: Only put unique element in a HoL? <someone@example.com>
regexp finite state machine? (Walter Roberson)
Re: Text::Template Question <edwin@webvoip.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Mar 2005 12:46:57 -0800
From: PietLaroy@hotmail.com (Piet L.)
Subject: Re: cant display generated html in browser (perl script)
Message-Id: <c47f81f6.0503081246.530c8fb2@posting.google.com>
> Anyhow this is not the 'right' way to use XSL on the web. You should
> simply put a processing instruction in the XML to tell the browser where
> to fetch the XSLT.
How do I do that?
------------------------------
Date: Tue, 08 Mar 2005 16:16:07 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: doubt regarding Symbolic references
Message-Id: <OeKdnaV0AsCKi7PfRVn-gg@comcast.com>
Rajesh wrote:
> Lets Consider a simple program like this
>
> $i = 'a';
> $a = "why is it so boring?";
> print "$$i";
>
> Now, the output will be the string "why is it so boring?" because $$i
> will now get referenced to $a and hence the string.
Yes, it will. Don't do that.
>
> Now, instead $i has the value $a . Something like,
>
> $i = '$a';
> $a = "why is it so boring?";
> print "$i";
>
> In this case, the output will be "$a" and not the string that is
> expected.
> But, I want the output to be the string. How would I get the value of a
> variable if another variable has this variable?
Don't. Use a hash.
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: 8 Mar 2005 13:32:22 -0800
From: julia_2683@hotmail.com (julia)
Subject: find command
Message-Id: <65a243bc.0503081332.18bb3221@posting.google.com>
This command doesn't seem to be correct.
find \&lsRuleFiles, "$rulesPath";
Does someone can give me examples of the right syntax to use find command ?
------------------------------
Date: Tue, 8 Mar 2005 22:56:00 +0100
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: find command
Message-Id: <MPG.1c983ddf39e72df9898c3@news.individual.de>
* julia wrote:
>
> This command doesn't seem to be correct.
>
> find \&lsRuleFiles, "$rulesPath";
To me, this seems to be a simple call to File::Find's find-method. And
if that agrees to your code (search for the string "use File::Find") I
cannot see any problem with the one line above (except the needless
quotes about $rulesPath).
>
> Does someone can give me examples of the right syntax to use find
> command ?
Have you already read the docs, e.g. at
http://search.cpan.org/~nwclark/perl-5.8.6/lib/File/Find.pm
? Perhaps you'll consider to show us some more lines of your code, and
explain what your code shall do.
regards,
fabian
------------------------------
Date: 8 Mar 2005 14:01:27 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: find command
Message-Id: <1110319287.740218.279240@o13g2000cwo.googlegroups.com>
julia wrote:
>
> This command doesn't seem to be correct.
>
> find \&lsRuleFiles, "$rulesPath";
>
> Does someone can give me examples of the right
> syntax to use find command ?
That looks correct to me -- providing you're using the find()
function from the File::Find module. I'll even include that exact line
in a small Perl script to demontrate that it is correct.
All this Perl script does is print out the names of all files and
directories found inside '.' (the current directory):
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
sub lsRuleFiles
{
print "Found $File::Find::name\n";
}
my $rulesPath = '.'; # the current directory
find \&lsRuleFiles, "$rulesPath";
__END__
So the line of code you provided works perfectly as is. If you
still have a problem, you'll have to provide us with a small program
that we can run to reproduce your exact problem. Once we can reproduce
your problem and see the exact error message(s) that you see, then we
can figure out what needs correcting.
I hope this helps, Julia.
-- Jean-Luc Romano
------------------------------
Date: Tue, 08 Mar 2005 22:18:02 +0000
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Re: find command
Message-Id: <cv8s2152u08rqvg9o3pmljssek052l162t@4ax.com>
On 8 Mar 2005 13:32:22 -0800, julia_2683@hotmail.com (julia) wrote:
>This command doesn't seem to be correct.
>
> find \&lsRuleFiles, "$rulesPath";
>
>Does someone can give me examples of the right syntax to use find command ?
perldoc file::find
NAME
File::Find - Traverse a directory tree.
SYNOPSIS
use File::Find;
find(\&wanted, @directories_to_search);
sub wanted { ... }
If that's not enough then you'll have to follow the posting
guidelines: create a small complete program that shows your problem
and post it, saying what behaviour you expected and what actually
happened.
------------------------------
Date: Tue, 8 Mar 2005 16:50:54 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: find command
Message-Id: <slrnd2sb2e.87b.tadmc@magna.augustmail.com>
julia <julia_2683@hotmail.com> wrote:
> This command doesn't seem to be correct.
^^^^^^^^^^^^
What did you observe that led you to belive that?
You should provide one or more symptoms if you hope for a diagnosis.
> find \&lsRuleFiles, "$rulesPath";
>
> Does someone can give me examples of the right syntax to use find command ?
The above _is_ the right syntax to use the find command
(apart from the useless use of quotes, don't do that)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Mar 2005 12:50:50 -0800
From: "dave@subcreations.com" <dave@subcreations.com>
Subject: How Perl Saved Planet Earth
Message-Id: <1110315050.694977.45150@o13g2000cwo.googlegroups.com>
The year is 2525. Anyone who even utters the word "evolution" is
immediately annihilated. Object oriented programming is owned by the
huge conglomerate Microsoft-Fox-Bush-Bin-laden.
Most "computers" are always on, but the radical underground have fitted
some with "off" buttons and there has been a wild rumor circulating
that someone has created an "interface" to a computer that allows a
certain amount of control over sequencing.
You don't find out until much later that people at the conglomerate
have not only known about these "interfaces" but other things as well.
You don't have time right now to explain how it is you wound up a
stowaway aboard an intergalactic conglomerate mining vessel and learned
of the Perl programming language by eavesdropping on the crew, but
after numerous stops on various planets, a horrible reality sets in.
As near as you can surmise, once "warp drive" became practical, the
conglomerate suddenly began to lower their prices of consumer goods
that obviously have been created in other galaxies on planets such as
these. Originally the whole concept of warp was very controversial
because scientists realized the dangerous paradoxes created by
excursions into the past and was only allowed if a space ship returned
after it departed (relative to conditions at departure).
This did not stop the conglomerate from sending "seed" ships into the
past (and out of the source tree) and returning at certain intervals to
make "harvests" and deal with local problems. (Usually by creating
"reality" using Fox news.)
You decided to remain behind on one of these planets to alert the
inhabitants to the fact that when the expiration date occurs, all the
planet's content will be harvested, and there will be no survivors.
You have learned enough about physics to realize that all the
technological answers currently exist on this planet so you set about
establishing communications between concerned scientists.
Having done so, you now become concerned with "over-population" and you
look in your Perl Cookbook to see what you can do about the problem.
Although your English is a bit rusty and some of the terms seem a bit
quaint, you start finding some programs that just might work.
Considering your initial impression of the educational system creating
"Zombies", that is where you start your search.
Good Fortune! On page 660 of the Perl Cookbook, you find the amazingly
simple solution to your problem under the heading, "16.19 Avoiding
Zombie Processes", where it says:
Problem: Your program forks children, but the dead children accumulate,
fill up your process table, and aggravate your system administrator.
Solution: If you don't need to record the children that have
terminated, use: $SIG{CHLD} = 'IGNORE';
To keep better track of deceased children, install a SIGCHLD handler to
call waitpid:
use POSIX ":sys_wait_h";
$SIG{CHLD} = \&REAPER;
sub REAPER {
my $stiff;
while (($stiff = waitpid(-1, WNOHANG)) > 0) {
# do something with $stiff if you want
}
SIG{CHLD} = \&REAPER; # install *after* calling waitpid
}
After considerable scrutiny, you determine that the children have been
forking mothers and fathers and that it is the mother forkers that are
the real problem because they are the actual cause of the forked up
children.
You are currently engaged in writing a CPAN module to contend with all
these mother forkers.
May the forks be with you...
------------------------------
Date: Tue, 8 Mar 2005 16:55:47 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to view error messages within a function
Message-Id: <slrnd2sbbj.87b.tadmc@magna.augustmail.com>
francescomoi@europe.com <francescomoi@europe.com> wrote:
> I'm trying to call a function:
> do my_function();
Why are you using that deprecated form of subroutine call?
> sub my_function()
Why are you using prototypes?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 08 Mar 2005 11:24:15 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: include external perl program
Message-Id: <080320051124152593%jgibson@mail.arc.nasa.gov>
In article <6a25ba72.0503080906.11cad2f9@posting.google.com>, Alythh
<alythh@netscape.net> wrote:
> I need to use an input file to a main perl program.
> Since I'm changing its shape often, and I'd like to add comments here
> and there, I was thinking to giving it the shape of a perl program by
> itself, like this:
>
> # comment
> # ...
> $inputvar1=2;
> # comment
> $inputvar2=2;
> ...
>
> and to include it some way in the main program.
> Problem is, I don't know which command is used to <include> a file.
> I heard about "use" and "require", but it seems to me that they're
> mostly used for defining big libraries and/or OOprogramming, isnt it?
>
> any hint?
You can use 'require' or 'do' for executing statements in an external
file. They work fine for simple applications such as the one you
describe. You might want to put a package declaration at the beginning
of the file and the line '1;' at the end of the file to indicate
successful compilation. You can then refer to the package variables in
the main program with the syntax '$package::variable'.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: 8 Mar 2005 12:42:27 -0800
From: mazzawi@gmail.com
Subject: Re: include external perl program
Message-Id: <1110314547.832877.250410@o13g2000cwo.googlegroups.com>
"They work fine for simple applications"
why would you just use 'do $File' for simple applications?
------------------------------
Date: Tue, 08 Mar 2005 13:26:57 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: include external perl program
Message-Id: <080320051326578676%jgibson@mail.arc.nasa.gov>
In article <1110314547.832877.250410@o13g2000cwo.googlegroups.com>,
<mazzawi@gmail.com> wrote:
> "They work fine for simple applications"
> why would you just use 'do $File' for simple applications?
>
I am not sure I understand your question. The OP said he wants to use
an input file to set variables by formatting it as Perl code that can
be executed, thereby "including" the input file as part of a Perl
program. That seems pretty simple to me, and either 'do', 'require', or
'use' will do the trick, depending upon the name and location of the
input file and when you want it to be executed.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: 8 Mar 2005 13:52:30 -0800
From: "usaims" <usaims@yahoo.com>
Subject: infinite loop (newbie)
Message-Id: <1110318750.245269.217910@z14g2000cwz.googlegroups.com>
Hello:
I am writing a script to make sure that numbers in a file are all
identical. However the script below is an infinite loop, how do I break
out of it once it hits the last element of the array? I have searched
perldoc but didn't really see anything. Am I on the right track?
#!/usr/bin/perl -w
use strict;
use warnings;
my @array = (<DATA>);
chomp(@array);
for (my $x = $array[0];$x <= $array[8]; $array[0]++)
{
print "They are even.\n";
}
__END__
1207553365
1207553365
1207553365
1207553365
1207553365
1207553365
1207553365
1207553365
1207553365
------------------------------
Date: Tue, 08 Mar 2005 23:06:39 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: infinite loop (newbie)
Message-Id: <396m6iF5ou10bU1@individual.net>
usaims wrote:
> I am writing a script to make sure that numbers in a file are all
> identical. However the script below is an infinite loop, how do I break
> out of it once it hits the last element of the array? I have searched
> perldoc but didn't really see anything. Am I on the right track?
Err.. No, not as far as I can see.
> for (my $x = $array[0];$x <= $array[8]; $array[0]++)
What did you expect that line to do? And why would you need to use a C
style for loop here?
As regards loops, please study
perldoc perlsyn
This is a possible solution to your problem:
my %hash = map { chomp; $_ => 1 } <DATA>;
print ( keys %hash > 1 ? 'not ' : '', "identical\n" );
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 08 Mar 2005 22:23:08 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: infinite loop (newbie)
Message-Id: <gBpXd.189792$K7.61156@news-server.bigpond.net.au>
"usaims" <usaims@yahoo.com> wrote in message
news:1110318750.245269.217910@z14g2000cwz.googlegroups.com...
: Hello:
: I am writing a script to make sure that numbers in a file are all
: identical. However the script below is an infinite loop, how do I break
: out of it once it hits the last element of the array? I have searched
: perldoc but didn't really see anything. Am I on the right track?
It sounds like you are looking for 'last'
: #!/usr/bin/perl -w
:
: use strict;
: use warnings;
:
: my @array = (<DATA>);
: chomp(@array);
:
: for (my $x = $array[0];$x <= $array[8]; $array[0]++)
in Perl we would probably write:
for (@array){
# etc
}
The above is difficult to maintain, especially if the array changes size...
BTW, that is not an infinite loop....
: {
: print "They are even.\n";
: }
P
--
print "Just another Perl Hacker";
------------------------------
Date: Tue, 08 Mar 2005 23:27:43 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: infinite loop (newbie)
Message-Id: <396ne7F5ummo4U1@individual.net>
Peter Wyzl wrote:
> "usaims" wrote:
>>
>> for (my $x = $array[0];$x <= $array[8]; $array[0]++)
>
> BTW, that is not an infinite loop....
Did you run it?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 8 Mar 2005 23:33:45 +0100
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: infinite loop (newbie)
Message-Id: <MPG.1c9846b466ee6029898c4@news.individual.de>
* usaims wrote:
>=20
> I am writing a script to make sure that numbers in a file are all
> identical. However the script below is an infinite loop, how do I break
> out of it once it hits the last element of the array? I have searched
> perldoc but didn't really see anything. Am I on the right track?
>=20
>=20
> my @array =3D (<DATA>);
> chomp(@array);
> for (my $x =3D $array[0];$x <=3D $array[8]; $array[0]++) {
> print "They are even.\n";
> }
Why do you want to iterate over all numbers between your first and last=20
line? For example, the more perlish =BB..=AB-operator does this job:
for my $x ( $array[0] .. $array[-1] ) {
print "They are even.\n";
}
Nevertheless, IIRC you asked a similar question a week ago. Why do you=20
don't use a hash since it was proposed there? I'll refresh your mind:
my %hash;
chomp, $hash{$_}++ while <DATA>;
for my $key ( keys %hash ) {
print "Number $key appears $hash{$key} times.\n";
}
In the thread last week David had used keys() to find out how many=20
different numbers are stored in this hash. What's the matter you don't=20
using it?
regards,
fabian
------------------------------
Date: 8 Mar 2005 14:47:59 -0800
From: "usaims" <usaims@yahoo.com>
Subject: Re: infinite loop (newbie)
Message-Id: <1110322079.482791.241100@z14g2000cwz.googlegroups.com>
I'm new to Perl. Learning hashes will be my next objective, sorry for
the posts and thanks in advance.
------------------------------
Date: Tue, 08 Mar 2005 20:53:29 +0100
From: peter pilsl <pilsl@goldfisch.at>
Subject: perl 5.8.5 segfaults on patternmatch
Message-Id: <422e02df$1@e-post.inode.at>
I recently discovered segfaulting of perl 5.8.5 doing many
patternmatches like /abc.*$/ and /^.*abc/ on a big datastructure.
I seem to able to avoid the problem by using the more accurate
searchpatterns /abc.*/ and /.*abc/ instead, but I generally wonder what
to do with a segfaulting perl ?
I tried to create a very short script demonstrating the problem, but
could not. The shortest version of my tool is still about 100 lines of
code and the inputfile (a stored hash) is about 1M. Does it make any
sense to upload the script, the inputfile and the coredump somewhere to
let anyone peek into it or is it just a bug and I should be happy to
have found a way around it?
thnx,
peter
--
http://www2.goldfisch.at/know_list
------------------------------
Date: 8 Mar 2005 12:41:27 -0800
From: "ArcadeFX" <arcadefx@msn.com>
Subject: perlce (perl and perlide)
Message-Id: <1110314487.199171.244330@f14g2000cwb.googlegroups.com>
Anyone use this application?
I installed it and every time I try and run a perl script I get "exit
-1" returned. This is from the PerlIDE. I did the cereg and I am not
sure what to try next.
Put it this way, I can't get the following code to work:
begin--
printf "hello world\n";
<STDIN>;
--end
Any suggestions or how to run "perl.exe" on wince?
------------------------------
Date: 8 Mar 2005 12:08:31 -0800
From: "invinity" <invinity@nvinity.net>
Subject: Praesideo: Latin for 'to watch over'
Message-Id: <1110312511.958530.109190@f14g2000cwb.googlegroups.com>
Hey all,
I am currently writing a module that is designed to automate the
startup and management of Apache processes. In addition, the module is
designed to provide a VirtualHost-like environment, but with a
dedicated Apache process for each host, all on a single IP address. I
am hoping to get lots of input about the practicality of this program
and my current namespace, which is "Praesideo". Actually, I am still in
the process of converting the modules over to the "Praesideo"
namespace. My old namespace is "Server::ApacheIVHost."
If you're still interested at this point, but don't want to read all
the stuff I wrote below, you can go directly to browsing the Praesideo
code at http://svn.nvinity.net/Server-ApacheIVHost/trunk. I have not
yet setup anything through CPAN, because the code is not mature enough.
Please remember that the code is still in the old namespace.
How:
At the heart of Praesedio is a daemon package, Overseer, which pulls in
host/domain info. and manages file/folders/Apache processes based on
certain settings. Each Apache process is launched with mod_perl
handlers set to tie it into the Praesideo system. Adding a new host
(i.e. 'test.mydomain.com') is simply a matter of adding the host
information to your storage system. The Overseer daemon will
automatically create directories and launch Apache. Eventually, I want
to write a web-based admin interface to make this even easier.
As stated above Praesideo provides a VirtualHost-like setup with
individual Apache processes. This is accomplished by running a master
Apache process on port 80 that proxies requests to the appropriate real
host, which is listening on a different port.
To store all the information about hosts and domains managed by
Praesideo, I created a pluggable API so that any storage method can be
used as long as someone writes the code for it. As of now, I have
concentrated efforts on a module for SQL based storage.
Why:
Even with the small network I run, I was still manually adding
VirutalHosts to my Apache configuration files more often than I wanted.
I also wanted my friends to be able customize the Apache configuration
of their host, but I didn't want them to be able to issue restart
commands to Apache or be able to bring down all my sites with a bad
configuration directive. In addition, I ran into times when I really
wanted a new website up, but I needed the Apache process to run under a
different user than the default. With Apache 2, the 'prechild' MPM
would provide this functionality, but was not stable and I'm not sure
if it even is today.
Concerns:
My biggest concern are the extra resources required to run a seperate
Apache process for each host. To midigate this, the number of child
processes started by each Apache process can be reduced, along with
restricting the DSOs loaded by each Apache process. In addition, I've
been looking into creating groups of hosts that are all run under the
same process to reduce the total number of Apache processes.
I appreciate your time and input.
Thanks,
Matt Pitts
invinity@nvinity.net
------------------------------
Date: 8 Mar 2005 20:46:34 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Praesideo: Latin for 'to watch over'
Message-Id: <Xns9613963AF529Bcastleamber@130.133.1.4>
invinity wrote:
> am hoping to get lots of input about the practicality of this program
> and my current namespace, which is "Praesideo". Actually, I am still
Since you are explaining in your subject what it means, do you think it's a
good name? How many people will make spelling errors do you think?
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Tue, 08 Mar 2005 22:09:16 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Q: Only put unique element in a HoL?
Message-Id: <gopXd.12788$gJ3.9695@clgrps13>
Magnus wrote:
>
> How do I only put unique element into a HoL? I do not want to add
> $element into HoL if it is already there. Here is my program so far,
> but this version adds every element for a $hashkey.
>
> Thanks in advance!
> Magnus
>
> while(<>)
> {
> chomp;
> my @line = split(/;/);
> # Set hashkey to $line[1] but only first 10 digits
^^^^^^^^^^^^^^^^^^^^^^^^
> my $hashkey = substr($line[1], 0, 9);
^
Then why are you only asking for the first nine characters?
Perhaps you meant:
my ( $hashkey ) = $line[1] =~ /^(\d{10})/;
John
--
use Perl;
program
fulfillment
------------------------------
Date: 8 Mar 2005 19:21:32 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: regexp finite state machine?
Message-Id: <d0ktvs$lua$1@canopus.cc.umanitoba.ca>
Keywords: DFA, regular expression, finite state machine
A few years ago, someone posted here with a reference to a module that
compiled standard regular expressions into a finite state machine
that could then be invoked. Sort of the reverse of DFA::Kleene,
and not requiring the full power of Parse::Lex because the only
necessary output is match / nomatch. Standard grep type regexps
are sufficient -- just the | [] . + * operators together
with ^ $ anchoring.
Would someone be able to steer me to the appropriate module?
(perl's pattern matcher does backtracking because it needs to be
more expressive than standard RE's. Regexp::Assemble helps some,
but still requires that perl's pattern matter be used; for what
I am doing, I am hoping for something that is time dependant
only on the length of the input string and independant of the
number of simple RE's being alternated.)
--
Look out, there are llamas!
------------------------------
Date: 8 Mar 2005 11:13:31 -0800
From: "webvoip" <edwin@webvoip.com>
Subject: Re: Text::Template Question
Message-Id: <1110309211.872714.262830@g14g2000cwa.googlegroups.com>
thanks fabian.
i did read the docs. i guess i didnt grasp the $OUT trick as well as
you did.
------------------------------
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 7867
***************************************