[19470] in Perl-Users-Digest
Perl-Users Digest, Issue: 1665 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 31 03:10:32 2001
Date: Fri, 31 Aug 2001 00:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999241815-v10-i1665@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 31 Aug 2001 Volume: 10 Number: 1665
Today's topics:
file search <bjlockie@nortelnetworks.com>
Re: file search <godzilla@stomp.stomp.tokyo>
Re: Godzilla Stomps Code Red <EvR@compuserve.com>
Re: Godzilla Stomps Code Red <godzilla@stomp.stomp.tokyo>
Re: Godzilla Stomps Code Red <matthew.garrish@sympatico.ca>
Re: Godzilla Stomps Code Red <Dave.Stafford@globis.net>
Re: HASH question <Jon.Ericson@jpl.nasa.gov>
Re: HASH question <Jon.Ericson@jpl.nasa.gov>
help with pipes please <khanrahan@cypresscom.net>
Re: Java mucks up split (Trewth Seeker)
Re: mod_perl problems - core dump using Socket or IO:So <goldbb2@earthlink.net>
Re: Passing code pieces to program <goldbb2@earthlink.net>
Re: perl "study" function in java? (Trewth Seeker)
Re: perl "study" function in java? (Abigail)
Perl 5.6.1 and PerlCC (B module) bombs using tie. (Jonan)
Q: ftp unix to pc file transfer , script needed u410400390@spawnkill.ip-mobilphone.net
Re: race condition? <goldbb2@earthlink.net>
Re: REGEX <fredrik.andersson@esavionics.se>
Re: regexp question with no answer yet (Trewth Seeker)
Re: regexp question with no answer yet (Trewth Seeker)
Re: regexp question with no answer yet (Trewth Seeker)
Re: Reporting Questionable Programming Activity (David Combs)
Re: s/\s+$// (Trewth Seeker)
Re: s/\s+$// <diablo@prometheus.humsoc.utas.edu.au>
Using Thread.pm <person@company.com>
Weird -w behaviour (Benoit Gauthier)
Re: Weird -w behaviour <samneric@tigerriverOMIT-THIS.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Aug 2001 23:17:54 -0400
From: "Bob Lockie" <bjlockie@nortelnetworks.com>
Subject: file search
Message-Id: <9mmvl3$g3e$1@bcarh8ab.ca.nortel.com>
I want to search a file for the last string matching (there are multiple):
"================ Start"
and then reread the file from that point.
I can search for the string and find the last one using the function "tell"
(is that portable?)
but I can't seem to rewind to that position (I tried the function
"sysseek").
------------------------------
Date: Thu, 30 Aug 2001 22:25:16 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: file search
Message-Id: <3B8F1FBC.5A643926@stomp.stomp.tokyo>
Bob Lockie wrote:
(snipped)
> I want to search a file for the last string matching (there are multiple):
> "================ Start"
> and then reread the file from that point.
Have your script walk through your file backwards until it
finds your key line. Note, this is key line, not key term.
Your script will be less complex and run faster if you seek
an entire line rather than add code to continue backwards
until a newline is found just previous to your line with
a keyterm. Otherwords, search for an entire line, not a
substring within a line.
There are methods to move through your file forwards
until a last key line is found. However, this style
usually requires more complex coding and, inherently,
is slower and less efficient than reading backwards.
I understand Uri Guttman has a method for reading a
file backwards. You might benefit from researching
whatever method he uses. Others say his method works
very well.
Godzilla!
--
#! perl
open (TEST, "test.txt");
$position = 0;
do
{
seek (TEST, -$position, 2);
$position++;
}
until (index (<TEST>, "line three") > -1);
while (<TEST>)
{ print $_; }
close (TEST);
exit;
CONTENTS OF test.txt:
__________________
line one
line two
line three
line four
line five
line six
PRINTED RESULTS:
_______________
line three
line four
line five
line six
------------------------------
Date: Thu, 30 Aug 2001 19:17:19 -0600
From: "Richard A. Evans" <EvR@compuserve.com>
Subject: Re: Godzilla Stomps Code Red
Message-Id: <9mmojq$f2b$1@suaar1aa.prod.compuserve.com>
From previous email:
> It is true my abilities to research and read, my ingenious
> Perl programming skills, my talents at writing efficient
>and imaginative Perl scripts, are a serious threat to these
> fragile masculine egos of weak-kneed men populating this
> newsgroup and, adequately devastate this diseased ego of
> The CLPM Troll.
And from another:
> What I think is of importance. What I think is I am moderately
> perturbed by your second incident of slinging racial slurs at
> me. Your first incident being a well remember one, an incident
> so abhorrent and morally repugnant, it is unsurpassed by any
> other racist events here on the internet. This first incident,
> is, of course, your posting of near two pages of vile, vulgar
> and vehement racial slurs, under your fake name, Joe Kline.
>
I know I will be flamed for making this observation, but I find it
interesting that you attack people for racial slurs, but seem to think
gender-based slurs are acceptable, as you so frequently attack men.
Furthermore, you seem quite willing to call people stupid, among other
things, which is a slur in itself. Hypocrisy?
I do not question your perl ability, as I have no knowledge of it, but I do
question the attitude you bring to this group. Personally I would be more
impressed with your abilities if you offered solutions to perl problems
rather than spewing attacks.
Regards,
Rick Evans
------------------------------
Date: Thu, 30 Aug 2001 19:32:21 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Godzilla Stomps Code Red
Message-Id: <3B8EF735.C385FE00@stomp.stomp.tokyo>
Richard A. Evans whined and cried:
(snipped)
> > It is true my abilities to research and read, my ingenious
> > Perl programming skills, my talents at writing efficient
> > and imaginative Perl scripts, are a serious threat to these
> > fragile masculine egos of weak-kneed men populating this
> > newsgroup....
> I know I will be flamed for making this observation, but I find it
> interesting that you attack people for racial slurs, but seem to think
> gender-based slurs are acceptable, as you so frequently attack men.
> Furthermore, you seem quite willing to call people stupid, among other
> things, which is a slur in itself. Hypocrisy?
> I do not question your perl ability, as I have no knowledge of it, but I do
> question the attitude you bring to this group. Personally I would be more
> impressed with your abilities if you offered solutions to perl problems
> rather than spewing attacks.
Listen Richard, fitting name, mind if I call you Dick?
Listen Dick, why don't you sit down before your knees
give way. Would you like some cheese with your whine?
Godzilla! A Serious Threat To Masculine Mental Stability.
------------------------------
Date: Thu, 30 Aug 2001 23:59:49 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Godzilla Stomps Code Red
Message-Id: <f_Dj7.61672$zP.4223791@news20.bellglobal.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:3B8EF735.C385FE00@stomp.stomp.tokyo...
<does anyone really care what "Godzilla" writes?>
I'm more interested in why you persist in pretending you are female when you
clearly write like a 16 year old male virgin who lives at home with his
parents and wanks off to internet porn when not posting overblown messages
to the newsgroups? Although I suppose you could also be a 35 year old virgin
who lives with his parents and wanks off to internet porn when not posting
overblown messages to the newsgroups...
Matt
------------------------------
Date: Fri, 31 Aug 2001 05:38:05 GMT
From: "Dave Stafford" <Dave.Stafford@globis.net>
Subject: Re: Godzilla Stomps Code Red
Message-Id: <1pFj7.464965$XL1.8277921@nlnews00.chello.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
> I am female. I do not type with my thumbs.
Ah, it was too quiet to be true.. summer camp must be over.
Still, he'll be back at school soon enough.
------------------------------
Date: 30 Aug 2001 17:02:46 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: HASH question
Message-Id: <861yltbhvt.fsf@jon_ericson.jpl.nasa.gov>
peter pilsl <pilsl_@goldfisch.at> writes:
> You need to read more about anonymous structures and hashes and arrays.
> This can all be quite confusing. Best you create a dump of your structure
> using the Dumper-Module from cpan.
I'm writing to you personally because I don't want to clutter up clpm
with private advice. I am not in anyway an authority in this
newsgroup (if you check the archives, I hardly ever post here), but I
am an active reader.
There is a pretty high standard for answering questions here. You
absolutely need to have the correct answer and it should be clear and
concise. For instance here you should have mentioned some specific
documentation to read (e.g. perldata), explained the confusion between
hashes and arrays (and why they are different creatures), and called
the Data::Dumper module by its correct name.
> I use a lot of very deep anonymous structures (the kind of
> $a->{key}->{subkey}->[4]->{subsubsubkey}... and this is very userful for
> maintaining loads of information. To give you an idea, this is a recursive
> subroutine that will destroy such a structure. It may answer some of your
> questions.
Sometimes it's helpful to think of answering a question as an exercise
in `programming' other people. In other words you want to tell them
what they need to know without confusing them with stuff they don't
need. If I were doing a `code-review' of the previous paragraph, I'd
label it as cruft (unneeded bits).
> sub dest
> #
> # delete the whole delivered structure
> #
> {
> my $ptr=shift;
> my $ptype=ref($ptr);
>
> if (not $ptype) # no pointer
> {
> # print "+";
[more code snipped]
Speaking of cruft, it's best to post polished code if you going to
post code at all. Comments that disable code rather than comment it
should be culled before posting.
I know it can be fun to answer questions, but it is (and should) take
a lot of work to do correctly. One thing that helps is reading the
group for a good, long time (measured in weeks to months). While
reading compose answers in your head and compare with the answers that
are actually given in the newsgroup. Then you might be in a position
to answer short, easy questions.
Believe it or not, answering questions can be a very difficult art.
Please take some time to do it well.
Thanks,
Jon
------------------------------
Date: 30 Aug 2001 17:05:33 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: HASH question
Message-Id: <86wv3la36q.fsf@jon_ericson.jpl.nasa.gov>
Jon Ericson <Jon.Ericson@jpl.nasa.gov> writes:
> I'm writing to you personally because I don't want to clutter up clpm
> with private advice. I am not in anyway an authority in this
> newsgroup (if you check the archives, I hardly ever post here), but I
> am an active reader.
Oops. Starting off with a lie is a bad idea. Teach me to read the
headers a bit more carefully.
Jon
------------------------------
Date: Thu, 30 Aug 2001 23:01:23 -0400
From: "Kevin" <khanrahan@cypresscom.net>
Subject: help with pipes please
Message-Id: <totv4072nanud2@corp.supernews.com>
I am trying to read log data, one line at a time as it comes in, and then
act upon it. If I use :
$alertmsg = <STDIN>;
......remainder of script....
and feed it manually it works great but I want it to be fed automatically so
instaed of using <STDIN> I tried:
$alertmsg = open(ALERT, "tail -f /opt/apps/logs/alarm.log|") or die "Can't
fork";
while(<ALERT>)
{
.....remainder of script........
and it dies when it gets new data! ....I am trying to take the result of tail -f /opt/apps/logs/alarm.log and use it
as input for the script..
What have I done wrong? This is my first attempt at a script....I am trying to understand the use of pipes
Thanks for any help
------------------------------
Date: 30 Aug 2001 23:26:25 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: Java mucks up split
Message-Id: <d690a633.0108302226.117c0f1e@posting.google.com>
abigail@foad.org (Abigail) wrote in message news:<slrn9op2u6.sp9.abigail@alexandra.xs4all.nl>...
> Trewth Seeker (trewth_seeker@yahoo.com) wrote on MMCMXX September
> MCMXCIII in <URL:news:d690a633.0108282134.61f58a7e@posting.google.com>:
> ??
> ?? I've filed a bug with Sun. But the problem is that "the Java groups"
> ?? simply won't *care* that Java has a broken version of Perl's facility,
> ?? and most Java users will be quite unaware that it *is* broken. Someone
> ?? asked why I want Java to do it right if I'm "a perler" -- I'm not "a perler",
> ?? I'm an engineer and a human being, and I care when things are broken.
> ?? I have trouble fathoming people who don't. Sun claims that these
> ?? facilities are taken from Perl, and I expected at least one
> ?? person in the Perl community (LW, for instance) to care that they
> ?? broke it in the process and thereby misrepresent Perl and introduce
> ?? pointless inconsistency into the programming community at large, and
> ?? my note was directed to such people. If Abigail or anyone else isn't
> ?? one of those people, they are free to ignore the thread.
>
>
> I still don't see an issue here. When Larry designed Perl, he "took"
> the block structure of C and put it into Perl. Except he didn't copy it
> exactly - braces are mandatory after if(), for(), etc, even if there's
> one statement.
>
> That didn't cause people in comp.lang.c whining Larry "broke" block
> structures.
You're a very rude person. And a hypocrite, since it is *you*
who is whining.
> Just because you take a feature from one language to
> incorporate in your own doesn't mean it needs to be copied exactly.
The interpretation of "limit" is quite obviously due to a
misunderstanding of its semantics.
> Is Java's split also "broken" because Java doesn't have a $* variable?
Are you a sophist for pay or just for pleasure?
------------------------------
Date: Thu, 30 Aug 2001 21:25:53 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: mod_perl problems - core dump using Socket or IO:Socket in startup.pl
Message-Id: <3B8EE7A1.74F35597@earthlink.net>
Stephen Wylie wrote:
>
> Thomas Bätzler wrote:
> > Hi,
> >
> > Stephen Wylie wrote:
> > > What controls the actual perl binary used by mod_perl? Any ideas?
> > You really should build your own matching Perl, Apache and mod_perl
> > yourself - mix'n'match is not a good approach for building a stable
> > Apache with mod_perl.
> >
> A nice idea, but we don't have a working C Compiler for AIX 4.3.3.
> I've had trouble installing gcc, and lots of people have posted saying
> it doesn't work anyway! I've been hoping to patch something up out of
> these binary distros to convince the bosses that there is merit in all
> this open-source stuff, but it's a bit uphill for a non-C programmer.
Have you considered using mod_fastcgi instead of mod_perl ?
If your Apache already has it installed, then you don't have to worry
about mixing and matching the binaries. And fastcgi can be just as fast
as mod_perl.
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: Thu, 30 Aug 2001 21:19:05 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Passing code pieces to program
Message-Id: <3B8EE609.733A8F08@earthlink.net>
Abigail wrote:
>
> Chas Friedman (friedman@math.utexas.edu) wrote on MMCMXII September
> MCMXCIII in <URL:news:3b82ed5c.13792869@news.itouch.net>:
> ,, Is there a way to pass pieces of code to a script as arguments?
> ,, For example, I have a script that uses File::Find, and contains
> ,, the expression: if (-M $_<1)....
> ,, I would like to be able to pass the "-M$_<1" to the script when it
> ,, is run (so I could also pass in other conditions.) I suppose I
> ,, could use an eval on some string made up partly of the passed in
> ,, arg, but I wondered if there is any other way. Thanks for any
> ,, comments.
>
> To get Perl to interpret a string as code, the string needs to be
> compiled. The compiler is automatically invoked on startup, and if
> you need to postpone compilation till runtime, the tool to wield is
> called eval, or one of its disguises (s///e, /(?{ })/).
You've a typo there -- s///e is not a form of eval, s///ee is.
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 30 Aug 2001 22:58:19 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: perl "study" function in java?
Message-Id: <d690a633.0108302158.1f9d8643@posting.google.com>
abigail@foad.org (Abigail) wrote in message news:<slrn9ons99.rpa.abigail@alexandra.xs4all.nl>...
> crypto_boy (crypto-boy@llnl.gov) wrote on MMCMXVIII September MCMXCIII in
> <URL:news:646ea35e.0108271446.56ba5d98@posting.google.com>:
> $$ Problem:
> $$ -----------------
> $$ I need to see if a one of many regexes match a fixed string in java.
>
> That's a Java problem, not a Perl one.
>
> $$ What I miss from perl is the "study" function.
>
> So? Then program in Perl, not in Java if you want a study function.
> The fact it's not there doens't hold any relevance in this Perl group.
>
>
> Please take your discussion out of the Perl group.
Saying "please" doesn't make you any less unpleasant a person.
------------------------------
Date: 31 Aug 2001 06:37:53 GMT
From: abigail@foad.org (Abigail)
Subject: Re: perl "study" function in java?
Message-Id: <slrn9ouc62.vug.abigail@alexandra.xs4all.nl>
Trewth Seeker (trewth_seeker@yahoo.com) wrote on MMCMXXII September
MCMXCIII in <URL:news:d690a633.0108302158.1f9d8643@posting.google.com>:
@@ abigail@foad.org (Abigail) wrote in message news:<slrn9ons99.rpa.abigail@alexandra.xs4all.nl>...
@@ > crypto_boy (crypto-boy@llnl.gov) wrote on MMCMXVIII September MCMXCIII in
@@ > <URL:news:646ea35e.0108271446.56ba5d98@posting.google.com>:
@@ > $$ Problem:
@@ > $$ -----------------
@@ > $$ I need to see if a one of many regexes match a fixed string in java.
@@ >
@@ > That's a Java problem, not a Perl one.
@@ >
@@ > $$ What I miss from perl is the "study" function.
@@ >
@@ > So? Then program in Perl, not in Java if you want a study function.
@@ > The fact it's not there doens't hold any relevance in this Perl group.
@@ >
@@ >
@@ > Please take your discussion out of the Perl group.
@@
@@ Saying "please" doesn't make you any less unpleasant a person.
I never claim I wasn't.
Abigail
--
perl -Mstrict -we '$_ = "goto Q.print chop;\n=rekcaH lreP rehtona tsuJ";Q1:eval'
------------------------------
Date: 30 Aug 2001 18:14:20 -0700
From: callisia@my-deja.com (Jonan)
Subject: Perl 5.6.1 and PerlCC (B module) bombs using tie.
Message-Id: <61fd3dec.0108301714.11bc8061@posting.google.com>
Hello,
I am using perl5.6.1 and perlcc to compile some code using the B
module. Everything works well except when using tie. I am using tie
with the GDBM_File and DB_File modules to tie a hash.
When ever any code with tie is run the executable ends up in a CPU
and memory eating loop never to return.
Is this a known problem ? Any work arounds ?
-Jonan
------------------------------
Date: Fri, 31 Aug 2001 02:08:48 GMT
From: u410400390@spawnkill.ip-mobilphone.net
Subject: Q: ftp unix to pc file transfer , script needed
Message-Id: <l.999223728.1606384277@[63.127.215.130]>
Hi,
I need a ftp perl script file that can run on a pc\dos environment
to get a file from a unix solaris 2.8 such systems after cd to a certain directory. The command to transfer the file should look like this:
scriptcommand <nameofthehost> <userid> <password> filename
does anyone has such script?.
Jim
--
Sent by msg124 from hotmail part from com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new
------------------------------
Date: Fri, 31 Aug 2001 02:26:24 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: race condition?
Message-Id: <3B8F2E10.8FDFFBF4@earthlink.net>
cp wrote:
>
> Jonah Klimack wrote:
> > I have a website in which members can
> > modify their information in a database.
> > (flat file text database)
> >
> > My code currently does this:
> >
> > #start pseudo
> > open file
> > lock file (shared)
> > load file contents into an array
> > close file
> >
> > splice out user's old entry from the array
> > push user's new info (from the form) on to the end of the array
> >
> > open file
> > lock file (exclusive)
> > print new array to file (overwriting contents of file)
> > close file
> > #end pseudo
> >
>
> See the FAQ : How do I change one line in a file/delete a line in a
> file/insert a line in the middle of a file/append to the beginning of
> a file?
>
> perldoc perlfaq5
>
> or:
> perldoc -q file
>
> Briefly, the technique outlined there is:
>
> open oldfile (readonly)
> open newfile (create|write)
>
> while (<oldfile>) {
> # change the lines that need changing, leave the lines that don't
> print each line to the new file
> }
>
> close old
> close new
> rename old -> old.bak
> rename new to old
>
> This can be easier on your system if the database file is large. With
> this method, you don't have to suck the whole file into an array. And
> this method creates a backup file for you.
But it doesn't do locking ... to combine this with locking, you need to
do the following:
open FILE, < , filename
LOCKLOOP: {
lock FILE, EX
open TMP, <, filename
unless( dev,inode(FILE) equals dev,inode(TMP) ) {
close FILE;
FILE = TMP;
redo LOCKLOOP;
}
}
open OUT, >, filename2
while( <FILE> ) {
change $_ as needed.
print OUT $_;
}
close OUT;
rename filename2, filename;
close FILE; # this line must be *after* the rename!
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: Fri, 31 Aug 2001 07:27:11 +0200
From: Fredrik Andersson <fredrik.andersson@esavionics.se>
Subject: Re: REGEX
Message-Id: <3B8F202F.EC7F5915@esavionics.se>
Dear Miss Godzilla
You need an oil-change on your sanity filter?
Best regards
Fredrik Andersson
------------------------------
Date: 30 Aug 2001 22:27:27 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: regexp question with no answer yet
Message-Id: <d690a633.0108302127.2546d77c@posting.google.com>
"Albretch" <lbrtchx@hotmail.com> wrote in message news:<998080524.199263@zver>...
> ... Cartesian products of string sets ...
>
> Thanks! This is within my line of thought, but I thought that was simply a
> method call something like (Java syntax)
>
> String[] azPlnExps = getPlainExpressions(azRegExp);
It will be after you write the method.
> I am amazed that apparently nobody stumbled on thsi problem before, since
> to me it should be a natural issue for regexps.
You're assuming facts not in evidence. But you haven't indicated
any practical use for this, which may suggest to you why
it might not be a "natural" issue. What you can find around
are *random* generators that produce random strings that
satisfy a grammar -- but such generators aren't usually limited
to regular grammars. Search google for "random expression generator"
or "random sentence generator".
> By the way, I studied Physics/Math in the TU Dresdens
So what?
Someone else wrote:
> Regular Expressions are for _recognizing_ strings in the grammar.
> Regular Grammars are for _generating_ strings in the grammar.
> First step would be to convert the regex to a Regular Grammar.
regexps *are* REPRESENTATIONS of regular grammars.
The issue is not of grammar vs. "expression", but of *recognizers*
(what the perl regex facility is) vs. *enumerators*.
Enumeration is really a rather trivial application of recursion,
and is a lot easier than recognition or parsing.
------------------------------
Date: 30 Aug 2001 22:36:08 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: regexp question with no answer yet
Message-Id: <d690a633.0108302136.445dbd0c@posting.google.com>
tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9nr1nl.bpv.tadmc@tadmc26.august.net>...
> http://www.csd.uwo.ca/research/grail/.man/
>
> retofl: convert regular expression to finite language
> (if the language of the expression is finite)
Close, but what you really want here is
retofm convert regular expression to finite-state machine
and
fmenum enumerate the language of a finite state machine
------------------------------
Date: 30 Aug 2001 22:40:50 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: regexp question with no answer yet
Message-Id: <d690a633.0108302140.7838f2a1@posting.google.com>
"Albretch" <lbrtchx@hotmail.com> wrote in message news:<998164476.826549@zver>...
> > Albretch <lbrtchx@hotmail.com> wrote:
> > >"Tad McClellan" <tadmc@augustmail.com> wrote in message
> > >news:slrn9nqmh0.b9t.tadmc@tadmc26.august.net...
> > >> Albretch <lbrtchx@hotmail.com> wrote:
> > >> >> If you *have* a maximal length, the solution is trivial: Generate
> > >> >> all strings of that or smaller length and apply the regex. Print
> > >> >> if match. Now, to do so efficiently...
>
> > >> > So my need is not such an "odd" one.
> >
> >
> > Then maybe a search engine might find something? ...
> >
> >
> > What do you plan to use this for?
> >
> > I can't think of any compelling reasons for wanting to do what
> > you want to do. Looks like you have such reasons. Care to share them?
>
> I am working on the design of a data structure that is sort of a
> (complicated and huge) linked list for fast searching ... at the end it is
> like an indexed text
>
> I want to give people the option to type in regexps as entry queries also
> from the web, but the ds does not work well with the FA thinking, therefore
> I need the actual strings and I thought this was something easy to get.
Um, it ain't gonna be fast if it has to check against the enumeration
of a billion strings. There are well-known algorithms for fast
searching based on regexp's; see, for instance, GNU egrep.
------------------------------
Date: 31 Aug 2001 06:32:57 GMT
From: dkcombs@panix.com (David Combs)
Subject: Re: Reporting Questionable Programming Activity
Message-Id: <9mnb2p$dug$1@news.panix.com>
In article <vSdg7.79478$ai2.5655604@bin2.nnrp.aus1.giganews.com>,
Jay Flaherty <fty@mediapulse.com> wrote:
>
>"David Combs" <dkcombs@panix.com> wrote in message
>news:9l0774$lh8$2@news.panix.com...
>> In article <hkxa7.207864$2O6.13515289@news2.aus1.giganews.com>,
>> Jay Flaherty <fty@mediapulse.com> wrote:
>> >"Smiley" <gurm@intrasof.com> wrote in message
>> >news:3b672381.218715906@news1.on.sympatico.ca...
>> >> The company I'm working for purchased a Perl CGI Script that turns out
>> >> to be seriously faulty - so much so that my boss asked me to
>> >> investigate whether there's any international agency or organization
>> >> set up that we can report this kind of thing to.
>> >>
>> >> Does anybody know? Thanks :)
>> >>
>> >
>> >Like an *International* lemon law? :-)
>> >
>> >
>>
>> I thought a "lemon law" made it *illegal* to complain
>> in an extremely-public way, eg by driving around in
>> a (buggy) car with a big lemon painted on each door.
>>
>> It was a *long* time ago that I read that -- and
>> I might have gotten it wrong, eg by 180 degrees.
>
>Don't have a clue but the first lemon law was in Connecticut in 1982:
>The "Lemon Law" is a nickname for Connecticut General Statute Chapter 743b,
>"Automotive Warranties". It establishes arbitration as an informal process
>for resolving disputes between consumers and automobile manufacturers. This
>does not cover extended warranties you buy separately.
>
>Jay
Ok. But where did the word "lemon" come from?
------------------------------
Date: 30 Aug 2001 22:53:55 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: s/\s+$//
Message-Id: <d690a633.0108302153.494858e1@posting.google.com>
vollesch@hotmail.com (Volker Schmidt) wrote in message news:<3b8e4ae1.32057295@News.CIS.DFN.DE>...
> Hi,
>
> We have a perl script here containing the following line:
>
> s/\s+$//
>
> Does anyone of you know what this operation is doing?
>
> Thanks,
> Volker
Perhaps you would like to post every other line in all your perl
scripts, requesting what each of those does. Perhaps we should
*all* do that -- wouldn't that be fun?
------------------------------
Date: Fri, 31 Aug 2001 16:34:18 +1000
From: "Mr Q. Z. Diablo" <diablo@prometheus.humsoc.utas.edu.au>
Subject: Re: s/\s+$//
Message-Id: <diablo-C93F9C.16341831082001@newsroom.utas.edu.au>
In article <d690a633.0108302153.494858e1@posting.google.com>,
trewth_seeker@yahoo.com (Trewth Seeker) wrote:
> vollesch@hotmail.com (Volker Schmidt) wrote in message
> news:<3b8e4ae1.32057295@News.CIS.DFN.DE>...
> > Hi,
> >
> > We have a perl script here containing the following line:
> >
> > s/\s+$//
> >
> > Does anyone of you know what this operation is doing?
> >
> > Thanks,
> > Volker
>
> Perhaps you would like to post every other line in all your perl
> scripts, requesting what each of those does. Perhaps we should
> *all* do that -- wouldn't that be fun?
Probably not, but the answer is so simple that it can be provided
quickly and easily rather than being rude and unpleasant. A simple
suggestion to look at a reference and/or read the FAQs would suffice.
For the original poster, the code removes all trailing whitespace from a
line.
Mr Q. Z. D.
----
Drinker, systems administrator, wannabe writer, musician and all-round bastard.
"If chance supplied a loaf of white bread,
Two casks of wine and a leg of mutton,
In the corner of a garden with a tulip-cheeked girl
There'd be enjoyment no Sultan could outdo." - Omar Khayyam.
------------------------------
Date: Thu, 30 Aug 2001 18:05:49 -0700
From: The Small Kahuna <person@company.com>
Subject: Using Thread.pm
Message-Id: <3B8EE2ED.A92F975@company.com>
I have access to perl versions 5.005_03 and 5.6.1. I'm trying to 'use
Thread;' and I keep getting: Can't locate Thread.pm in @INC. I did a
find $DIR -follow -name Thread.pm on the entire directory tree (which
took a while) and it ain't there.
So, fine, I go to CPAN.org and search for "thread". the only thing that
comes back is a pod document. Fine, so now I know what I'm doing (uh,
like right...).
But no thread.pm. So I tried to look at the module list by name. Under
thread/ is a bunch of thread::somethingorother modules and also
perl5.6.1.tar.gz.
So the light bulb brightens ever so little and it appears to me as if
Thread.pm is supposed to be one of those "standard" modules that comes
out of the box (so to speak). But still I don't seem to have it for
some reason and IT will call me back Any Week Now with "yes, its not
there [click]".
So whats a poor perl hacker to do? Is there any place I can get "just
Thread"? If I download the entire perl package I won't be able to
install it because of carefully controlled access and other justified
paranoia. (IT: "sure, just put it in /usr/bin" - Bzzt.)
------------------------------
Date: Fri, 31 Aug 2001 01:20:07 GMT
From: gauthier@circum.com (Benoit Gauthier)
Subject: Weird -w behaviour
Message-Id: <3b8ee534.26523751@news.videotron.ca>
(2001.08.30, 21:15)
I am encountering the weirdest situation. I have the following test
script:
#! /usr/bin/perl
print "Content-type: text/html\n\n";
print "<HEAD>\n";
print "</HEAD>\n";
print "Hello\n";
Run under Apache, it returns an "internal server error". The entries
in the erorr log are:
[Thu Aug 30 21:13:26 2001] [error] (2)No such file or directory: exec
of /var/www/html/cgi/test.cgi failed
[Thu Aug 30 21:13:26 2001] [error] [client 24.200.5.172] Premature end
of script headers: /var/www/html/cgi/test.cgi
Meanwhile, if I add the -w switch on the first line, it works fine! It
also works like a charm from a telnet or ssh command line.
What gives?
Please reply to both the newsgroup and my e-mail. Thanks in advance.
Benoît Gauthier, mailto:gauthier@circum.com
Réseau Circum inc. / Circum Network Inc.
Enregistrez votre adresse élec. pour être informé(e)
des nouvelles de Circum à l'URL http://circum.com
Register your e-mail to be informed of Circum news at
http://circum.com
74, rue du Val-Perché, Hull, Québec (Canada) J8Z 2A6
+1 819.770.2423 télec. fax: +1 819.770.5196
==============================================
* * * Essayez des options : courriel avec The Bat!, Web avec Opera
* * * Try alternatives : e-mail with The Bat!, Web with Opera
http://www.ritlabs.com/the_bat/
http://www.opera.com/
------------------------------
Date: Thu, 30 Aug 2001 23:01:56 -0400
From: Samneric <samneric@tigerriverOMIT-THIS.com>
Subject: Re: Weird -w behaviour
Message-Id: <MPG.15f8c7bd49f1c1ab9896a8@news.onemain.com>
Benoit Gauthier wrote:
[snip]
> [Thu Aug 30 21:13:26 2001] [error] (2)No such file or directory: exec
> of /var/www/html/cgi/test.cgi failed
"/usr/bin/perl^M" isn't on your server. No such file.
"/usr/bin/perl -w^M" is.
Your script contains carriage returns.
------------------------------
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.
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 1665
***************************************