[22290] in Perl-Users-Digest
Perl-Users Digest, Issue: 4511 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 4 14:08:26 2003
Date: Tue, 4 Feb 2003 11:06:39 -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, 4 Feb 2003 Volume: 10 Number: 4511
Today's topics:
Re: 100 levels deep redux. <rdsmith@sedona.intel.com>
Re: 100 levels deep redux. <flavell@mail.cern.ch>
Re: 16 bit application <bkennedy@hmsonline.com>
Re: Crossposting (was: Fetchrow Question) <mgarrish@rogers.com>
Re: Crossposting (was: Fetchrow Question) <uri@stemsystems.com>
Re: Crossposting (was: Fetchrow Question) (Ben Morrow)
Fast de-tabify <irving_kimura@lycos.com>
Re: Fast de-tabify (Ben Morrow)
Re: Fast de-tabify <bigj@kamelfreund.de>
Re: Getting username in authenticated CGI site ciaranm@uk.removethisbit.ibm.com
Re: Getting username in authenticated CGI site <spamfilter@cheiron-it.nl>
Re: Getting username in authenticated CGI site <tony_curtis32@yahoo.com>
Re: Getting username in authenticated CGI site <je@brighton.ac.uk>
Re: Getting username in authenticated CGI site <je@brighton.ac.uk>
Re: Getting username in authenticated CGI site <je@brighton.ac.uk>
Re: Getting username in authenticated CGI site <je@brighton.ac.uk>
How To Decode HTML Unicode Entities? (Lee Goddard)
Re: How To Decode HTML Unicode Entities? (Ben Morrow)
Re: Is there a *better* way to deref and look for match (denap)
Re: Perl Operations <uri@stemsystems.com>
Re: perl simple script (Tad McClellan)
Re: perlfaq4.pod - question re. pack examples (Lee Goddard)
Re: Text extraction using patterns (Perl FAQ 6 not help (Stephen Adam)
The Solution - aka UGH! <shanem@nospam.ll.mit.edu>
Re: Until loop not working with multiple conditions <usenet@dwall.fastmail.fm>
Re: Until loop not working with multiple conditions (h\)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 04 Feb 2003 10:16:50 -0700
From: Ron Smith <rdsmith@sedona.intel.com>
Subject: Re: 100 levels deep redux.
Message-Id: <3E3FF582.48E2EE73@sedona.intel.com>
Benjamin Goldberg wrote:
>
> Ron Smith wrote:
> >
> > I'm still having the classic 100 levels deep issue when using the
> > debugger.
>
> Type perldoc -l DB, open that file in your editor, and change $deep from
> 100 to something larger. [untested]
>
> --
> "So, who beat the clueless idiot today?"
> "Well, we flipped for it, but when Kuno
> landed, he wasn't in any shape to fight."
> "Next time, try flipping a *coin.*"
Actually this was very close to the correct answer. I'm not sure what
DB.pm is or if and when it gets "use"d (which is what was printed out by
the above) but it was not the solution. If it were used, it would have
required edit because the $deep variable is a lexical. It turns out
that perl5db.pl has a global package variable $DB::deep which is set to
100. If I set it to some large number (like 10,000) right at the
debugger prompt (or in my script itself) it runs my example script to
completion without producing the error/warning.
I also notice that if I likewise set the variable to a large number, I
can now step beyond my "real" deep recursion and see my problem.
Thanks
------------------------------
Date: Tue, 4 Feb 2003 18:22:04 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: 100 levels deep redux.
Message-Id: <Pine.LNX.4.53.0302041820390.4005@lxplus089.cern.ch>
On Feb 4, Ron Smith inscribed on the eternal scroll:
> Benjamin Goldberg wrote:
[...]
> > "Well, we flipped for it, but when Kuno
> > landed, he wasn't in any shape to fight."
> > "Next time, try flipping a *coin.*"
>
> Actually this was very close to the correct answer.
I think it would be wise to snip the parts of your quotage which
do not relate to your followup.
SCNR
------------------------------
Date: Tue, 4 Feb 2003 12:09:52 -0500
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: 16 bit application
Message-Id: <NDKdncDYUPraaaKjXTWcpQ@giganews.com>
"Scott" <myhvac@hotmail.com> wrote in message
news:35ff4733.0302032056.5c32783@posting.google.com...
> Can Perl interact with a 16 bit application? I have a company where
> their software is written in a visual basic 16 bit program and I want
> to develop for them a html interface using Perl.
How does your 16 bit program interact with the outside world? Perl can use
the IPC::Open2 module to communicate with external processes via STDIN and
STDOUT, if that is how your program chooses to communicate.
--Ben Kennedy
------------------------------
Date: Tue, 04 Feb 2003 16:09:11 GMT
From: "mgarrish" <mgarrish@rogers.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <HAR%9.555155$F2h1.421665@news01.bloor.is.net.cable.rogers.com>
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7n0lcskv0.fsf@mail.sysarch.com...
> >>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
>
> so low volume and mostly wrong is better than high volume (which is
> easily handled with a good newsreader) which has many perl experts
> around?
>
You really aren't very good with logic are you? His assertion was that the
only people who read alt.perl fell into his two simplistic categories. CLPM
has only a few people who could be considered "experts" (of which you are
not one, I'm afraid), but a vast number of people who think they are because
all they can say is RTFM or parrot the answers of the one or two experts.
Matt
------------------------------
Date: Tue, 04 Feb 2003 16:23:05 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <x7ptq8qal3.fsf@mail.sysarch.com>
>>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
m> "Uri Guttman" <uri@stemsystems.com> wrote in message
m> news:x7n0lcskv0.fsf@mail.sysarch.com...
>> >>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
>>
>> so low volume and mostly wrong is better than high volume (which is
>> easily handled with a good newsreader) which has many perl experts
>> around?
>>
m> You really aren't very good with logic are you? His assertion was
m> that the only people who read alt.perl fell into his two simplistic
m> categories. CLPM has only a few people who could be considered
m> "experts" (of which you are not one, I'm afraid), but a vast number
m> of people who think they are because all they can say is RTFM or
m> parrot the answers of the one or two experts.
i think my logic is fine. you are slamming clpm for being rtfm mostly
while other call alt.perl a place for those who don't want to learn
proper perl. well, why don't you stay in alt.perl and lead the kiddies
and let the experts stay here and teach good perl. as for my perl
expertise, i don't think you are qualified to judge it nor is your
opinion worth anything here.
so please go back to alt.perl and stay there. you must be happy
answering all the same questions over and over with such personalized
answers that are better than the docs. oh, i don't see that happening (i
lurk in alt.perl) so you are just being a typical hypocrit who flames
other people but can't do the job themselves.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
Date: Tue, 4 Feb 2003 18:16:05 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <b1p015$nk6$1@wisteria.csv.warwick.ac.uk>
"mgarrish" <mgarrish@rogers.com> wrote:
>
>"Uri Guttman" <uri@stemsystems.com> wrote in message
>news:x7n0lcskv0.fsf@mail.sysarch.com...
>> >>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
>>
>> so low volume and mostly wrong is better than high volume (which is
>> easily handled with a good newsreader) which has many perl experts
>> around?
>>
>
>You really aren't very good with logic are you? His assertion was that the
>only people who read alt.perl fell into his two simplistic categories. CLPM
>has only a few people who could be considered "experts" (of which you are
>not one, I'm afraid)
*plonk*
Ben
------------------------------
Date: Tue, 4 Feb 2003 17:16:49 +0000 (UTC)
From: Irving Kimura <irving_kimura@lycos.com>
Subject: Fast de-tabify
Message-Id: <b1osi1$l0l$1@reader1.panix.com>
Is there a faster Perl code to "de-tabify" a long string than this?:
$no_tabs =
join "\n",
map { s/([^\t]*)\t/$1 . (' ' x (8-(length($1)%8)))/eg; $_ }
split /\n/, $string_with_tabs;
Thanks,
-Irv
------------------------------
Date: Tue, 4 Feb 2003 18:34:53 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Fast de-tabify
Message-Id: <b1p14d$od6$1@wisteria.csv.warwick.ac.uk>
Irving Kimura <irving_kimura@lycos.com> wrote:
>
>
>Is there a faster Perl code to "de-tabify" a long string than this?:
>
>$no_tabs =
> join "\n",
> map { s/([^\t]*)\t/$1 . (' ' x (8-(length($1)%8)))/eg; $_ }
> split /\n/, $string_with_tabs;
use Text::Tabs;
Ben
------------------------------
Date: Tue, 04 Feb 2003 18:36:09 +0100
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: Fast de-tabify
Message-Id: <pan.2003.02.04.17.35.54.285857@kamelfreund.de>
On Tue, 04 Feb 2003 17:16:49 +0000, Irving Kimura wrote:
> Is there a faster Perl code to "de-tabify" a long string than this?:
Write it in C :-)
> $no_tabs =
> join "\n",
> map { s/([^\t]*)\t/$1 . (' ' x (8-(length($1)%8)))/eg; $_ }
> split /\n/, $string_with_tabs;
Another idea could be to avoid making caclutions.
Let's say
my @space = map {' ' x 8 - ($_ % 8)} (0 .. 1000);
and now
$no_tabs = join "\n",
map { s/([^\t]*)\t/$1 . $space[length $1]/eg; $_ }
split /\n/, $string_with_tabs;
You should also try to replace
length($1) with
$+[1] - $-[1]
[all untested]
Best Wishes,
Janek
------------------------------
Date: Tue, 4 Feb 2003 14:15:40 +0000 (UTC)
From: ciaranm@uk.removethisbit.ibm.com
Subject: Re: Getting username in authenticated CGI site
Message-Id: <b1ohuc$109e$1@sp15at20.hursley.ibm.com>
> Can anyone tell me how to get at the username please?
Does $ENV{'REMOTE_USER'} give you what you want?
------------------------------
Date: Tue, 4 Feb 2003 16:00:00 +0100
From: "Frank Maas" <spamfilter@cheiron-it.nl>
Subject: Re: Getting username in authenticated CGI site
Message-Id: <3e3fd65f$0$154$e4fe514c@dreader7.news.xs4all.nl>
"John English" <je@brighton.ac.uk> schreef in bericht
news:3E3FB9C7.54F56946@brighton.ac.uk...
> I've got an Apache server on Linux using LDAP authentication, and I
> want my CGI scripts to be able to get at the username supplied when
> authenticating access to the site. I can't find anything relevant in
> the environment, and "print `whoami`" says "apache" as the effective
> user id...
>
> Can anyone tell me how to get at the username please?
You did not tell us how you use your CGI scripts, but for the two most
frequent cases:
Using CGI.pm:
my $q = new CGI;
my $user = $q->remote_user();
Using mod_perl:
sub handler {
my $r=Apache::Request->new();
my $user=$r->user();
}
--Frank
------------------------------
Date: Tue, 04 Feb 2003 09:02:00 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting username in authenticated CGI site
Message-Id: <87znpcdr87.fsf@limey.hpcc.uh.edu>
>> On Tue, 04 Feb 2003 13:01:59 +0000,
>> John English <je@brighton.ac.uk> said:
> I've got an Apache server on Linux using LDAP
> authentication, and I want my CGI scripts to be able to
> get at the username supplied when authenticating access
> to the site. I can't find anything relevant in the
> environment, and "print `whoami`" says "apache" as the
> effective user id...
Yeah, this is completely unrelated to HTTP-based
authentication.
> Can anyone tell me how to get at the username please?
perldoc CGI
remote_user ()
Return the authorization/verification name used for
user verification, if this script is protected.
hth
t
------------------------------
Date: Tue, 04 Feb 2003 16:13:43 +0000
From: John English <je@brighton.ac.uk>
Subject: Re: Getting username in authenticated CGI site
Message-Id: <3E3FE6B7.A0E79A93@brighton.ac.uk>
Tony Curtis wrote:
>
> > Can anyone tell me how to get at the username please?
>
> perldoc CGI
>
> remote_user ()
> Return the authorization/verification name used for
> user verification, if this script is protected.
Alas, I've already tried this, but remote_user returns null. I'm
using auth_ldap 1.6.0; do I have to do anything out of the ordinary
to get this module to set REMOTE_USER to the username?
-----------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS **
University of Brighton | -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
------------------------------
Date: Tue, 04 Feb 2003 16:14:30 +0000
From: John English <je@brighton.ac.uk>
Subject: Re: Getting username in authenticated CGI site
Message-Id: <3E3FE6E6.AA804C44@brighton.ac.uk>
ciaranm@uk.removethisbit.ibm.com wrote:
>
> > Can anyone tell me how to get at the username please?
>
> Does $ENV{'REMOTE_USER'} give you what you want?
'Fraid not; REMOTE_USER isn't defined. I'm using auth_ldap 1.6.0,
and it doesn't seem to set up REMOTE_USER. Any other ideas?
-----------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS **
University of Brighton | -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
------------------------------
Date: Tue, 04 Feb 2003 16:16:57 +0000
From: John English <je@brighton.ac.uk>
Subject: Re: Getting username in authenticated CGI site
Message-Id: <3E3FE779.CA79B3B6@brighton.ac.uk>
Frank Maas wrote:
>
> "John English" <je@brighton.ac.uk> schreef in bericht
> news:3E3FB9C7.54F56946@brighton.ac.uk...
> > I've got an Apache server on Linux using LDAP authentication, and I
> > want my CGI scripts to be able to get at the username supplied when
> > authenticating access to the site. I can't find anything relevant in
> > the environment, and "print `whoami`" says "apache" as the effective
> > user id...
> >
> > Can anyone tell me how to get at the username please?
>
> You did not tell us how you use your CGI scripts, but for the two most
> frequent cases:
>
> Using CGI.pm:
> my $q = new CGI;
> my $user = $q->remote_user();
I've tried this (also $ENV{REMOTE_USER}) but it seems that auth_ldap
1.6.0 doesn't set up REMOTE_USER as I would have expected...
-----------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS **
University of Brighton | -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
------------------------------
Date: Tue, 04 Feb 2003 16:31:18 +0000
From: John English <je@brighton.ac.uk>
Subject: Re: Getting username in authenticated CGI site
Message-Id: <3E3FEAD6.8E462715@brighton.ac.uk>
John English wrote:
>
> Tony Curtis wrote:
> >
> > > Can anyone tell me how to get at the username please?
> >
> > perldoc CGI
> >
> > remote_user ()
> > Return the authorization/verification name used for
> > user verification, if this script is protected.
>
> Alas, I've already tried this, but remote_user returns null. I'm
> using auth_ldap 1.6.0; do I have to do anything out of the ordinary
> to get this module to set REMOTE_USER to the username?
I'm not sure what I did, but I've just upgraded my Apache from 1.3
to 2.0 and it all works fine now...
-----------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS **
University of Brighton | -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
------------------------------
Date: 4 Feb 2003 06:18:46 -0800
From: nospam@leegoddard.com (Lee Goddard)
Subject: How To Decode HTML Unicode Entities?
Message-Id: <e0d7abe8.0302040618.227222f6@posting.google.com>
How to decode HTML entities of Unicode characters?
HTML::Entities 1.26 can't or won't.
tia
lee
use HTML::Entities;
print HTML::Entities::decode_entities('榟棲歘אּﭢ')
# Prints 榟棲歘אּﭢ
------------------------------
Date: Tue, 4 Feb 2003 18:31:59 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: How To Decode HTML Unicode Entities?
Message-Id: <b1p0uv$o9k$1@wisteria.csv.warwick.ac.uk>
nospam@leegoddard.com (Lee Goddard) wrote:
>How to decode HTML entities of Unicode characters?
>HTML::Entities 1.26 can't or won't.
>
>tia
>lee
>
>use HTML::Entities;
>
>print HTML::Entities::decode_entities('榟棲歘אּﭢ')
>
># Prints 榟棲歘אּﭢ
WorksForMe with perl 5.8.0. I suspect the extra Unicode support in 5.8 may
be necessary. Note that you'll have to rebuild HTML::Entities (and
everything else) as 5.8.0 is not binary-compatible with 5.6.1.
Ben
------------------------------
Date: 4 Feb 2003 06:24:33 -0800
From: denap@yahoo.com (denap)
Subject: Re: Is there a *better* way to deref and look for matches?
Message-Id: <850c108f.0302040624.3a2f2d3b@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3E3EFEEC.93ABFB5A@earthlink.net>...
> denap wrote:
> >
> > perl-newbie...
> >
> > Here's a slow code snippet:
> >
> > for $i (0 .. $#array){
> > for $j (0 .. $#{$array[$i]}) {
> > my @formula = @{$array[$i][$j]};
> > foreach my $func (@formula) {
>
> This part could be replaced with:
>
> for(@array) { for(@$_) { for my $func (@$_) {
>
> Note, though, that since $func will alias to successive elements of your
> original data -- so changing it, changes your data. Before, with your
> code, changing $func only changes elements of @formula, which is a copy
> of your data.
that's fine. Ultimately there's one more line to make an assignement
when there's been a replace.
>
> > my $orig = $func = lc $func;
>
> Ehh, surely you meant:
>
I supposed...I feel like I'm being told to eat my green beans...
> $func = lc(my $orig = $func);
>
> > for my $key (keys %sfunc_repl) {
> > if ($func =~ /$key/) {
> > $func =~
> > s/$sfunc_repl{$key}->[SEARCH]/$sfunc_repl{$key}->[REPLACE]/e;
>
> Repeated looping over %sfunc_repl is probably not the best thing in the
> world to be doing, if you can avoid it. What's inside of the
> $sfunc_repl{$key}->[SEARCH] part? Are these regexen, or literal
> strings?
>
> What's in the ->[REPLACE] part? Is this thing a tied variable, or
> perhaps a blessed ref with an overloaded stringify? If it's not either
> of these, then why is there that /e on the replacement?
>
> Also, what kind of strings are in $func?
that's supposed to be /ee...
The SEARCH (arr position 0) is a regex, to save off function args into
$1...$N. The REPLACE (arr position 1) is the new arg order for a new
API.
Now... ...not the best thing in the world to be doing...
...tied variable...
...blessed ref with overloaded stringify...
I'm not sure what/why you made these stmts. Can you elaborate, for my
own edification, as to what you mean?
thanks
------------------------------
Date: Tue, 04 Feb 2003 16:11:25 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl Operations
Message-Id: <x7u1fkqb4j.fsf@mail.sysarch.com>
>>>>> "BR" == Brandon Reddish <mechman991@hotmail.com> writes:
BR> This is a pretty generic question, but does anyone have a link to a
BR> list of Perl modules, and there uses / definitions? This would be
BR> great, thanks. :)
www.cpan.org
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
Date: Tue, 4 Feb 2003 08:14:20 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: perl simple script
Message-Id: <slrnb3vils.6uq.tadmc@magna.augustmail.com>
Janek Schleicher <bigj@kamelfreund.de> wrote:
> On Mon, 03 Feb 2003 10:09:15 -0800, zr wrote:
>
>> It was 'suggested' by the client to do it in perl, and I was told
>> perl's regexp is more powerfull than grep's (the regexp can be
>> complicated). But maybe it could work just with a grep...
>
> You should also have a look to the Perl Power Tools
> (http://search.cpan.org?query=PPT&mode=all)
> There's a tcgrep tool that is similar to unix grep, but with Perl regexps.
Or simulate grep with a Perl one-liner:
perl -ne 'print if /PATTERN/' files...
>> Thanks to all (not to you, Tassilo, get a life)
^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^
So long then.
> In fact, I had the same opinion like him!
Me too, but I let it slide (until the followup displaying
the OP's gimme-gimme attitude).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 4 Feb 2003 06:21:10 -0800
From: nospam@leegoddard.com (Lee Goddard)
Subject: Re: perlfaq4.pod - question re. pack examples
Message-Id: <e0d7abe8.0302040621.2ee72c11@posting.google.com>
Thanks Anno, Ben.
lee
------------------------------
Date: 4 Feb 2003 09:31:06 -0800
From: 00056312@brookes.ac.uk (Stephen Adam)
Subject: Re: Text extraction using patterns (Perl FAQ 6 not helping!!)
Message-Id: <945bf980.0302040931.67c5a41a@posting.google.com>
Thanks for the response Tad but I think you got what I was saying
wrong.
I always try to make sure my posts make sense, and in this case I am
sure it does.
>> I am trying to extract some information from a dynamically created
>> HTML page. The information I want always starts with "< class=g>"
^^^^^^^^^^
>>That is not legal HTML...
>>(actually it is legal, but it is content, not markup)
<P class=g> IS perfectly legal markup for setting CSS settings for the
text, if you don't believe me search on Google and then look in the
source. In this case it all ways marks the beginning of a listing for
a web site.
>> our $htmlpage = "random stuff zz here is some stuff I want xx some
>> more random stuff zz and here is some other stuff I want xx and yet
>> more random stuff";
>You should get an empty array from that data, as it does not
>contain any of the things you said you are looking for.
This is completely wrong as if you actually read the whole of my post
you would have noticed the line
>Let's say I want to extract all the text which starts with zz and
>finishes with xx and copy each occurrence of this into an array
>element.
I just simplified the problem and gave accurate test data which would
NOT have resulted in a blank array.
>If you can't be troubled to provide realistic data, it is unlikely
>that you will find a volunteer to both make data, and then answer
>your question. You have not made in easy to answer your question.
I am troubled to spend the time providing a clear and concise
description of my problem, and I already had had one accurate response
back when you posted. I know my questions are not always perfectly
phrased and if you want to comment on that (constructively) then fair
enough, but please read my post before telling me it does not make
sense.
Cheers
Steve
------------------------------
Date: Tue, 04 Feb 2003 10:58:50 -0500
From: Shane McDaniel <shanem@nospam.ll.mit.edu>
Subject: The Solution - aka UGH!
Message-Id: <3E3FE33A.553048F0@nospam.ll.mit.edu>
So it looks like my problem was that the perl install where I work is at
5.004, and the Class::Struct that comes with that install has a bug
where it returns refs to refs instead of refs for hashes and arrays.
Lovely.
It's only been around longer than I've been using perl.
-shane
------------------------------
Date: Tue, 04 Feb 2003 18:33:24 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Until loop not working with multiple conditions
Message-Id: <Xns931889E7EDB54dkwwashere@216.168.3.30>
Jürgen Exner <jurgenex@hotmail.com> wrote on 04 Feb 2003:
> Janek Schleicher wrote:
>>
>> for my $count (1 .. 5) {
>> last if $param eq 'Y';
>> # ...
>
> This is arguable. For the OPs version of the loop it's obvious how to
> find a post condition.
> I'm not sure how you would do that for your version of the loop.
>
> But maybe you are not interested in program verification....
I had to look up "post condition". First I found
http://www.cs.unc.edu/~stotts/COMP145/CRC/DesByContract.html
Then I thought of lookng on Ward's Wiki and went to
http://c2.com/cgi/wiki?DesignByContract
which of course led me to all sort of other things.
During lunch I went back to reading "The Pragmatic Programmer" and reached
page 109 where there's a whole section devoted to design by contract.
I guess I'm learning, or at least finding out how ignorant I am. :-)
--
David K. Wall - usenet@dwall.fastmail.fm
"Oook."
------------------------------
Date: Tue, 4 Feb 2003 20:00:09 +0100
From: "Michael Peuser \(h\)" <post@mpeuser.de>
Subject: Re: Until loop not working with multiple conditions
Message-Id: <b1p2hu$mel$02$1@news.t-online.com>
"David K. Wall" <usenet@dwall.fastmail.fm> schrieb im Newsbeitrag
news:Xns931889E7EDB54dkwwashere@216.168.3.30...
>
> During lunch I went back to reading "The Pragmatic Programmer" and reached
> page 109 where there's a whole section devoted to design by contract.
>
> I guess I'm learning, or at least finding out how ignorant I am. :-)
>
Nevertheless you seem to be a fast reader (or a slow eater?)
Kindly Mike
------------------------------
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 4511
***************************************