Re: lc() with undefined arg
- From: "Tassilo v. Parseval" <tassilo.von.parseval@xxxxxxxxxxxxxx>
- Date: Sat, 13 Aug 2005 08:26:11 +0200
Also sprach Anno Siegel:
> Tassilo v. Parseval <tassilo.von.parseval@xxxxxxxxxxxxxx> wrote in comp.lang.perl.misc:
>> Also sprach ced@xxxxxxxxxxxxxxxxxxxxx:
>>
>> > Tassilo v. Parseval wrote:
>
> [...]
>
>> But I don't see how the functions mentioned in this thread fall into
>> this category. Meanwhile, I found one other builtin that wont warn on
>> undef: 'reverse' in scalar context.
>>
>> What is worse about these cases is the fact that after applying any of
>> these functions, the value is no longer undef but the empty string. In a
>> context of a program these two values might have a very different
>> meaning and silently transforming one into the other is wrong.
>
> That's only a consequence of some functions stringifying their argument,
> the same goes for hash keys. I wouldn't worry about it, a programmer
> doesn't expect a function like lc to return its argument unchanged. I think
> it's just a missing "uninitialized" warning -- add that and reverse and
> lc fit right in.
Yes, I am not worried about the empty string that is produced but the
fact that it happens silently. When I get warnings about uninitialized
values it's almost always a bug in my programs. So that's a warning I
cannot do without.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
.
- Follow-Ups:
- Re: lc() with undefined arg
- From: Len
- Re: lc() with undefined arg
- References:
- lc() with undefined arg
- From: Len
- Re: lc() with undefined arg
- From: Tassilo v. Parseval
- Re: lc() with undefined arg
- From: ced@xxxxxxxxxxxxxxxxxxxxx
- Re: lc() with undefined arg
- From: Tassilo v. Parseval
- Re: lc() with undefined arg
- From: Anno Siegel
- lc() with undefined arg
- Prev by Date: FAQ 3.20 How can I hide the source for my Perl program?
- Next by Date: FAQ 4.23 How do I find matching/nesting anything?
- Previous by thread: Re: lc() with undefined arg
- Next by thread: Re: lc() with undefined arg
- Index(es):
Relevant Pages
|
|