[prog] Re: speaking Perlish
Meryll Larkin
alwanza at oz.net
Mon Oct 28 02:00:20 EST 2002
Thanks, Jacinta,
Good to hear from another woman keeping the "she" in "she-bang".
I completely agree, and all good points.
As for "unless", I'm a great fan of TMTOWTDI.
For anyone less familiar with Perl, that's
"There's More Than One Way To Do It"
Meryll
> With an understanding of how Perl converts numbers you may understand why
> it is that your test cases worked fine. Data validation, however, is a
> great idea. Note, though, that the above prevents floating point values.
> This is because \D is the same as [^0-9] and . is not in 0-9. An
> alternative regexp would be:
> $live =~ s/[^0-9.]//g;
>
>
>
>>if (!$live) { # make sure there is a number in there.
>> print "Please answer numerically. Quitting.\n";
>> exit 1;
>>}
>
>
> I prefer unless myself. ;)
> unless($live) {
> print ".....";
> exit 1;
> }
>
> Great job Kenny.
>
> Jacinta
>
More information about the Programming
mailing list