Re: lc() with undefined arg
- From: anno4000@xxxxxxxxxxxxxxxxxxxxxxx (Anno Siegel)
- Date: 12 Aug 2005 22:20:39 GMT
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.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
.
- Follow-Ups:
- Re: lc() with undefined arg
- From: Tassilo v. Parseval
- 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
- lc() with undefined arg
- Prev by Date: Re: Perl numerics: EPSILON and equality between floats
- Next by Date: Re: Padding Problem UPDATE (Still broken)
- Previous by thread: Re: lc() with undefined arg
- Next by thread: Re: lc() with undefined arg
- Index(es):
Relevant Pages
|
|