[30336] in Perl-Users-Digest
Perl-Users Digest, Issue: 1579 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 26 11:14:23 2008
Date: Mon, 26 May 2008 08:14:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 26 May 2008 Volume: 11 Number: 1579
Today's topics:
reinstall perl <yingun@gmail.com>
Re: reinstall perl <noreply@gunnar.cc>
Re: reinstall perl <yingun@gmail.com>
Re: reinstall perl <noreply@gunnar.cc>
Re: reinstall perl <yingun@gmail.com>
Re: reinstall perl <yingun@gmail.com>
Re: reinstall perl <1usa@llenroc.ude.invalid>
Re: reinstall perl <1usa@llenroc.ude.invalid>
Re: reinstall perl <yingun@gmail.com>
Re: reinstall perl <szrRE@szromanMO.comVE>
Re: reinstall perl <RedGrittyBrick@SpamWeary.foo>
Re: reinstall perl <noreply@gunnar.cc>
Re: reinstall perl <yingun@gmail.com>
Re: Why reading the FAQs is good (example) <uri@stemsystems.com>
Re: Why reading the FAQs is good (example) <dragnet\_@_/internalysis.com>
Re: Why reading the FAQs is good (example) <benkasminbullock@gmail.com>
Re: Why reading the FAQs is good (example) <@..invalid>
Re: Why reading the FAQs is good (example) <1usa@llenroc.ude.invalid>
Re: Why reading the FAQs is good (example) <dragnet\_@_/internalysis.com>
Re: Why reading the FAQs is good (example) <dragnet\_@_/internalysis.com>
Re: Why reading the FAQs is good (example) <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 26 May 2008 02:57:29 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: reinstall perl
Message-Id: <584b2b29-c1be-42e5-818a-8c36200cb1d0@c19g2000prf.googlegroups.com>
Hello, I have perl interpreter install using sypnatic package manager,
now I want to reinstall perl from the source code with different
configuration setting. Should I remove the perl first from the
sypnatic package ? when I try to to so they are a lot of package that
depend on perl, it seems unwise. So I just resinstall from source
directly,
./Configure -doptimize='-g'
make
Making x2p stuff
make[1]: Entering directory `/home/william/p/perl-5.8.8/x2p'
You haven't done a "make depend" yet!
make[1]: *** [hash.o] Error 1
make[1]: Leaving directory `/home/william/p/perl-5.8.8/x2p'
make: *** [translators] Error 2
When I run
make depend
sh ./makedepend MAKE=make
./makedepend: Already running, exiting.
test -s perlmain.c && touch perlmain.c
cd x2p; make depend
make[1]: Entering directory `/home/william/p/perl-5.8.8/x2p'
sh ../makedepend MAKE=make
../makedepend: Already running, exiting.
make[1]: Leaving directory `/home/william/p/perl-5.8.8/x2p'
How to solve this ? Thanks
------------------------------
Date: Mon, 26 May 2008 14:16:35 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: reinstall perl
Message-Id: <69vnthF353o6qU1@mid.individual.net>
Keenlearner wrote:
> Hello, I have perl interpreter install using sypnatic package manager,
> now I want to reinstall perl from the source ...
Do not multi-post!
http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100925.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 26 May 2008 05:24:53 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: Re: reinstall perl
Message-Id: <e290e0d4-5aeb-474e-adb7-1d2c86b90aa6@w5g2000prd.googlegroups.com>
On May 26, 8:16=A0pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Keenlearner wrote:
> > Hello, I have perl interpreter install using sypnatic package manager,
> > now I want to reinstall perl from the source ...
>
> Do not multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05/ms=
g100925.html
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
Ops, sorry, I thought that was different mailing list.
I was thrilled at first, because I thought finally someone has given
the solution. ;-)
------------------------------
Date: Mon, 26 May 2008 14:44:49 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: reinstall perl
Message-Id: <69vpifF35qioeU1@mid.individual.net>
Keenlearner wrote:
> On May 26, 8:16 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> Keenlearner wrote:
>>> Hello, I have perl interpreter install using sypnatic package manager,
>>> now I want to reinstall perl from the source ...
>> Do not multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100925.html
>
> Ops, sorry, I thought that was different mailing list.
So what? By multi-posting, without letting people know that you did,
there is a risk that people spend time helping you on one place without
knowing that the problem was resolved on the other place. Please show
the Perl community some respect by not abusing its resources that way.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 26 May 2008 05:57:21 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: Re: reinstall perl
Message-Id: <910ffdbb-9c97-465c-9e36-2ae9be4a7fce@w1g2000prd.googlegroups.com>
On May 26, 8:24=A0pm, Keenlearner <yin...@gmail.com> wrote:
> On May 26, 8:16=A0pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>
> > Keenlearner wrote:
> > > Hello, I have perl interpreter install using sypnatic package manager,=
> > > now I want to reinstall perl from the source ...
>
> > Do not multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05/=
msg100925.html
>
> > --
> > Gunnar Hjalmarsson
> > Email:http://www.gunnar.cc/cgi-bin/contact.pl
>
> Ops, sorry, I thought that was different mailing list.
>
> I was thrilled at first, because I thought finally someone has given
> the solution. ;-)
Ok, maybe I put my question in this way. How can I build another
version of Perl with the debugging information ? So that I can still
use the non-debugging version of Perl ? Thanks
------------------------------
Date: Mon, 26 May 2008 06:12:07 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: Re: reinstall perl
Message-Id: <5b599a85-9cf2-4938-a093-5f5be2275fc6@i18g2000prn.googlegroups.com>
On May 26, 8:44=A0pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Keenlearner wrote:
> > On May 26, 8:16 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> >> Keenlearner wrote:
> >>> Hello, I have perl interpreter install using sypnatic package manager,=
> >>> now I want to reinstall perl from the source ...
> >> Do not multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05=
/msg100925.html
>
> > Ops, sorry, I thought that was different mailing list.
>
> So what? By multi-posting, without letting people know that you did,
> there is a risk that people spend time helping you on one place without
> knowing that the problem was resolved on the other place. Please show
> the Perl community some respect by not abusing its resources that way.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
I have done this before and found it very helpful, because the
solution that both group given are different and helpful, they became
part and parcel to complete each other. When I got the solution, I did
nd would post the solution on the other if I got the solution on the
respective group.
Btw, I did respect the community and said sorry, I never know that
comp.lang.perl.misc is almost the same.
------------------------------
Date: Mon, 26 May 2008 13:39:51 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: reinstall perl
Message-Id: <Xns9AAA624E6E132asu1cornelledu@127.0.0.1>
Keenlearner <yingun@gmail.com> wrote in
news:5b599a85-9cf2-4938-a093-5f5be2275fc6@i18g2000prn.googlegroups.com:
> On May 26, 8:44 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> Keenlearner wrote:
>> > On May 26, 8:16 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> >> Keenlearner wrote:
>> >>> Hello, I have perl interpreter install using sypnatic package
>> >>> manager,
>
>> >>> now I want to reinstall perl from the source ...
>> >> Do not
>> >> multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05
> /msg100925.html
>>
>> > Ops, sorry, I thought that was different mailing list.
That is a different group, that's right.
Therefore, you should not multi-post.
If you do not understand what you are being asked not to do, you could
use a search engine to figure it out:
http://www.google.com/search?q=multi-posting
>> --
>> Gunnar Hjalmarsson
>> Email:http://www.gunnar.cc/cgi-bin/contact.pl
Do *NOT* quote signs.
> I have done this before and found it very helpful, because the
> solution that both group given are different and helpful,
See, that is exactly what you are being asked not to do.
Why should people waste time and energy answering a question you already
got answered somewhere else.
> they became part and parcel to complete each other.
That's great for you.
> Btw, I did respect the community and said sorry, I never know that
> comp.lang.perl.misc is almost the same.
I don't know what you mean by that but you are probably mistaken.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Mon, 26 May 2008 13:41:49 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: reinstall perl
Message-Id: <Xns9AAA62A3574BAasu1cornelledu@127.0.0.1>
Keenlearner <yingun@gmail.com> wrote in
news:910ffdbb-9c97-465c-9e36-2ae9be4a7fce@w1g2000prd.googlegroups.com:
> How can I build another version of Perl with the debugging information ?
Read the instructions that came with the distribution.
> So that I can still use the non-debugging version of Perl ? Thanks
Install the debugging version in a different location.
Find out how to do that by reading the instructions rather than asking
someone else to read them for you.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Mon, 26 May 2008 06:57:53 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: Re: reinstall perl
Message-Id: <2f1e7f40-ab01-4d60-81a8-95b4dda331df@v26g2000prm.googlegroups.com>
On May 26, 9:41=A0pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> Keenlearner <yin...@gmail.com> wrote innews:910ffdbb-9c97-465c-9e36-2ae9be=
4a7fce@w1g2000prd.googlegroups.com:
>
> > How can I build another version of Perl with the debugging information ?=
>
> Read the instructions that came with the distribution.
>
> > So that I can still use the non-debugging version of Perl ? Thanks
>
> Install the debugging version in a different location.
>
> Find out how to do that by reading the instructions rather than asking
> someone else to read them for you.
>
> Sinan
>
> --
> A. Sinan Unur <1...@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:http://www.rehabitation.com/clpm=
isc/
Sorry, apologise me. I would read. Thanks.
------------------------------
Date: Mon, 26 May 2008 07:02:14 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: reinstall perl
Message-Id: <g1eft7016af@news4.newsguy.com>
Keenlearner wrote:
> On May 26, 8:16 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> Keenlearner wrote:
>>> Hello, I have perl interpreter install using sypnatic package
>>> manager, now I want to reinstall perl from the source ...
>>
>> Do not
>> multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100925.html
>
> Ops, sorry, I thought that was different mailing list.
Actually it _is_ a different list. This news group and the nntp.perl.org
server are separate, so calling it multi-posting is not really correct
(that implies posting to multiple groups on the same server.) I don't
see why one cannot post in both areas, as it can increase the possible
results (since they are completely separate.)
--
szr
------------------------------
Date: Mon, 26 May 2008 15:30:05 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: reinstall perl
Message-Id: <mqadnco5lZLtVKfVnZ2dneKdnZydnZ2d@bt.com>
szr wrote:
> Keenlearner wrote:
>> On May 26, 8:16 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>>> Keenlearner wrote:
>>>> Hello, I have perl interpreter install using sypnatic package
>>>> manager, now I want to reinstall perl from the source ...
>>> Do not
>>> multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100925.html
>> Ops, sorry, I thought that was different mailing list.
>
> Actually it _is_ a different list. This news group and the nntp.perl.org
> server are separate, so calling it multi-posting is not really correct
> (that implies posting to multiple groups on the same server.) I don't
> see why one cannot post in both areas, as it can increase the possible
> results (since they are completely separate.)
>
One *can* post separately to both places but IMO one should usually not
do so without *very* good reason. So far as I can see, the arguments
against multi-posting mostly apply.
- People who frequent both places end up seeing the question several times.
- People who don't frequent both places end up wasting time answering
questions that have been already answered elsewhere.
etc.
There may be an argument for posting first in one place, waiting a week
and posting in another place if no answers have been obtained. In this
case it would be polite to mention that the question has already been
posted in the other place. I doubt this is ever necessary for the two
places in question.
Just my ¤0.02 worth.
--
RGB
------------------------------
Date: Mon, 26 May 2008 16:32:27 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: reinstall perl
Message-Id: <69vvs9F349k1oU1@mid.individual.net>
szr wrote:
> Keenlearner wrote:
>> On May 26, 8:16 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>>> Do not
>>> multi-post!http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100925.html
>>
>> Ops, sorry, I thought that was different mailing list.
>
> Actually it _is_ a different list. This news group and the nntp.perl.org
> server are separate, so calling it multi-posting is not really correct
> (that implies posting to multiple groups on the same server.) I don't
> see why one cannot post in both areas, as it can increase the possible
> results (since they are completely separate.)
Because doing so is ruthless.
To me, the fact that they are on separate servers is irrelevant. IMO,
you abuse the community just as much by posting to both simultaneously,
whether the correct term is multi-posting or something else.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 26 May 2008 08:02:07 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: Re: reinstall perl
Message-Id: <136457e7-a4fc-49f8-a9ef-f4ba9ff7231f@u36g2000prf.googlegroups.com>
As I said, once I got the answer from one post, I would post the
solution to the other post. That would solve most of it.
>it can increase the possible
> results (since they are completely separate.)
It happened here that it has higher probability of getting various and
better result. Also I learned more.
http://www.nntp.perl.org/group/perl.beginners/2008/05/msg100775.html
http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/5e2d923994e833d9#
Rather than keep arguing this, does anyone still remember the main
problem ?
After I ran,
./Configure -Dusethreads -Dprefix=p/perl/ -Doptimize='-g'
Then
make
Making DynaLoader (static)
make[1]: Entering directory `/home/william/p/perl-5.8.8/ext/
DynaLoader'
Makefile out-of-date with respect to ../../lib/Config.pm ../../
config.h
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1
../../miniperl "-I../../lib" "-I../../lib" Makefile.PL
"INSTALLDIRS=perl" "PERL_CORE=1" "LIBPERL_A=libperl.a"
Processing hints file hints/linux.pl
Writing Makefile for DynaLoader
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command. <==
false
make[1]: *** [Makefile] Error 1
make[1]: Leaving directory `/home/william/p/perl-5.8.8/ext/DynaLoader'
Extracting xsubpp (with variable substitutions)
make[1]: Leaving directory `/home/william/p/perl-5.8.8/utils'
Making x2p stuff
make[1]: Entering directory `/home/william/p/perl-5.8.8/x2p'
You haven't done a "make depend" yet!
make[1]: *** [hash.o] Error 1
make[1]: Leaving directory `/home/william/p/perl-5.8.8/x2p'
make: *** [translators] Error 2
Above are the two portions of errors that I am having. Thanks
------------------------------
Date: Mon, 26 May 2008 04:09:14 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <x7prr9so46.fsf@mail.sysarch.com>
>>>>> "MB" == Marc Bissonnette <dragnet\_@_/internalysis.com> writes:
MB> Marc Bissonnette <dragnet\_@_/internalysis.com> fell face-first on the
MB> keyboard. This was the result:
MB> news:Xns9AA9EF2C4CC97dragnetinternalysisc@216.196.97.131:
>> Uri Guttman <uri@stemsystems.com> fell face-first on the keyboard.
>> This was the result: news:x7y75xsqvx.fsf@mail.sysarch.com:
>> /^\+?-?\d?\.?\d*$/
MB> Apologies for following up my own post: I just realized the above has a
MB> flaw: It matches on or zero beginning digits (.4 or 0.4) but not two digits
MB> or more (22.4)
MB> This works better:
MB> /^\+?-?(\d?|\d+)\.?\d*$/
the middle part is silly. it matches 0 or 1 digit OR one or more
digits. that is the same as 0 or more digits which is \d* all by itself.
but you can't use \d*\.?\d* as that will match the empty string (as will
your regex above). everything in yours is optional. look at this:
perl -ne 'print "yes\n" if /^\+?-?(\d?|\d+)\.?\d*$/'
yes
+
yes
+-
yes
note that the blank line was input. as i said, matching decimal numbers
is not trivial. use regexp::common as it has solved that problem.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Mon, 26 May 2008 00:11:59 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <Xns9AAAC265FD17dragnetinternalysisc@216.196.97.131>
Uri Guttman <uri@stemsystems.com> fell face-first on the keyboard. This
was the result: news:x7prr9so46.fsf@mail.sysarch.com:
>>>>>> "MB" == Marc Bissonnette <dragnet\_@_/internalysis.com> writes:
>
> MB> Marc Bissonnette <dragnet\_@_/internalysis.com> fell face-first
> on the MB> keyboard. This was the result:
> MB> news:Xns9AA9EF2C4CC97dragnetinternalysisc@216.196.97.131:
>
> >> Uri Guttman <uri@stemsystems.com> fell face-first on the keyboard.
> >> This was the result: news:x7y75xsqvx.fsf@mail.sysarch.com:
>
> >> /^\+?-?\d?\.?\d*$/
>
> MB> Apologies for following up my own post: I just realized the
> above has a MB> flaw: It matches on or zero beginning digits (.4 or
> 0.4) but not two digits MB> or more (22.4)
>
> MB> This works better:
>
> MB> /^\+?-?(\d?|\d+)\.?\d*$/
>
> the middle part is silly. it matches 0 or 1 digit OR one or more
> digits. that is the same as 0 or more digits which is \d* all by
> itself.
>
> but you can't use \d*\.?\d* as that will match the empty string (as
> will your regex above). everything in yours is optional. look at this:
>
> perl -ne 'print "yes\n" if /^\+?-?(\d?|\d+)\.?\d*$/'
>
> yes
> +
> yes
> +-
> yes
>
> note that the blank line was input. as i said, matching decimal
> numbers is not trivial. use regexp::common as it has solved that
> problem.
Many thanks for the pointers and solution - I will indeed look into
regexp::common
At the very least, it's been instructional/educational - As I mentioned,
I've got a few bad habits and long-ways-around-the-bush to correct :)
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: Mon, 26 May 2008 12:20:59 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <g1e9vb$47q$1@ml.accsnet.ne.jp>
On Sun, 25 May 2008 21:10:03 -0500, Marc Bissonnette wrote:
> # replace decimals with 999999999 in order to check for non-numerical #
> data, then switch it back (this is a lazyman's shortcut)
>
> $in{hours} =~ s/\./999999999/;
> if ($in{hours} =~ /\D/) {
> push @missing,'Hours contains non-numerical data'; $missing =
1;
> }
> $in{hours}=~s/999999999/\./;
If your original is something like
3579.2468
then after the second substitution you'll have
357.92468
You should use a string like ABCDEFG for this, where nothing is repeated.
------------------------------
Date: Mon, 26 May 2008 06:50:29 -0700
From: "Gordon Etly" <@..invalid>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <69vth7F357r4pU1@mid.individual.net>
Marc Bissonnette wrote:
> Uri Guttman <uri@stemsystems.com> fell face-first on the keyboard.
> > note that the blank line was input. as i said, matching decimal
> > numbers is not trivial. use regexp::common as it has solved that
> > problem.
> Many thanks for the pointers and solution - I will indeed look into
> regexp::common
It's actually Regexp::Common. The casing makes a difference if
installing from the CPAN command-line, as well as when 'use'ing the
module. I would thing Uri would know that.
--
G.Etly
------------------------------
Date: Mon, 26 May 2008 13:52:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <Xns9AAA6479B6C95asu1cornelledu@127.0.0.1>
Marc Bissonnette <dragnet\_@_/internalysis.com> wrote in
news:Xns9AA9E172266E9dragnetinternalysisc@216.196.97.131:
> -? match a minus sign once or not at all
Match the optional minus sign is more descriptive IMHO.
> I *think* this means
> "Warn {text} unless the input *only* matches minus signs, digit
> characters and decimals, from the beginning to the end of the string"
I don't think verbalization attempts like this are useful. You already
did a pretty good job dissecting the regex and that's good. But the
statement above is a little too loose.
> I tried the above with the following in test.pl just to try to
> reinforce it in my mind:
>
> $foo = '3.5'; # no warning
> $foo = '5'; # no warning
> $foo = '-1'; # no warning
> $foo = '4x4'; # warning - non-digit
> $foo = '--3.2' # warning - more than one minus
> $foo = '3.5.5' # warning - more than one decimal
How about $foo = '+3.1'? Do you want that to be considered numeric?
> Now that section of my code is:
>
> if ($in{hours} !~ /^-?\d+\.?\d*$/) {
How about $foo = '-3.'? Do you want that to be a number or a typo?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Mon, 26 May 2008 08:58:13 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <Xns9AAA656B0F2C3dragnetinternalysisc@216.196.97.131>
"Gordon Etly" <@..invalid> fell face-first on the keyboard. This was the
result: news:69vth7F357r4pU1@mid.individual.net:
> Marc Bissonnette wrote:
>> Uri Guttman <uri@stemsystems.com> fell face-first on the keyboard.
>
>> > note that the blank line was input. as i said, matching decimal
>> > numbers is not trivial. use regexp::common as it has solved that
>> > problem.
>
>> Many thanks for the pointers and solution - I will indeed look into
>> regexp::common
>
> It's actually Regexp::Common. The casing makes a difference if
> installing from the CPAN command-line, as well as when 'use'ing the
> module. I would thing Uri would know that.
Yep, I always do the search from the CPAN command line before the
installation. While I know there are all lower-case modules out there, I
don't think I've ever installed one (odd point, but...)
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: Mon, 26 May 2008 09:00:01 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <Xns9AAA65B92A048dragnetinternalysisc@216.196.97.131>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> fell face-first on the keyboard.
This was the result: news:Xns9AAA6479B6C95asu1cornelledu@127.0.0.1:
> Marc Bissonnette <dragnet\_@_/internalysis.com> wrote in
> news:Xns9AA9E172266E9dragnetinternalysisc@216.196.97.131:
>
>> -? match a minus sign once or not at all
>
> Match the optional minus sign is more descriptive IMHO.
>
>
>> I *think* this means
>> "Warn {text} unless the input *only* matches minus signs, digit
>> characters and decimals, from the beginning to the end of the string"
>
> I don't think verbalization attempts like this are useful. You already
> did a pretty good job dissecting the regex and that's good. But the
> statement above is a little too loose.
>
>> I tried the above with the following in test.pl just to try to
>> reinforce it in my mind:
>>
>> $foo = '3.5'; # no warning
>> $foo = '5'; # no warning
>> $foo = '-1'; # no warning
>> $foo = '4x4'; # warning - non-digit
>> $foo = '--3.2' # warning - more than one minus
>> $foo = '3.5.5' # warning - more than one decimal
>
> How about $foo = '+3.1'? Do you want that to be considered numeric?
>
>> Now that section of my code is:
>>
>> if ($in{hours} !~ /^-?\d+\.?\d*$/) {
>
> How about $foo = '-3.'? Do you want that to be a number or a typo?
You're right - I think I caught all of those in my latest interation, but
as Uri points out, it passes a blank string, which isn't a good thing, so
Regexp::Common looks like the smartest thing for the best coverage.
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: Mon, 26 May 2008 15:27:30 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <ivtqg5-ej6.ln1@osiris.mauzo.dyndns.org>
Quoth Marc Bissonnette <dragnet\_@_/internalysis.com>:
>
> Yep, I always do the search from the CPAN command line before the
> installation. While I know there are all lower-case modules out there, I
> don't think I've ever installed one (odd point, but...)
Modules with names in all-lowercase are pragmata: they affect the way
perl parses your program. The only ones that are usually used are the
ones that come with perl: strict, warnings, open, encoding, &c. There
are some pragmata on CPAN, but they are generally rather advanced
modules that interact with the perl core in subtle and complicated ways.
Ben
--
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based
on the strictest morality. [Samuel Butler, paraphrased] ben@morrow.me.uk
------------------------------
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 V11 Issue 1579
***************************************