FAQ

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

Edward Peschko
Feb 21, 2001 at 12:35 am

Can you give me an example of the former?
I can't think of any off the top of my head.
Scalar value @foo[$bar] better written as $foo[$bar], for one.

If part of Perl's breeding is autovivication and interpretation of undef as
0 or "" in the appropriate context, why should Perl bitch at me if I use it
as such? Why should I have to ask permission to do so?
Well, for one, your example is ill-considered. You are going to get
autovivification saying:

@foo[$bar] = 1;

just as much as you are going to get autovivification for:

$foo[$bar] = 1;

Hence I'd say that @foo[$bar] has NO INTRINSIC VALUE whatsoever.

Second, with the keyword empty (if it comes to pass) the reasons for
interpretation of undef as 0 and "" go away. Right now, things are a PITA
to get empty values:

my ($a, $b, $c, $d, $e) = ('') x 5;

With empty:

my ($a, $b, $c, $d, $e) = empty;
I would rather say, and I think it would be more perlish to say, "I'm not
feeling particularly perly today, can you check for anything clever, cause
if there is, chances are it's a mistake."
Or how about "I'm feeling particularly lazy today, I think I'll sleep in. Lets
worry about any mistakes I might make another day."

For i maintain that any 'cleverness' that you might have that causes warnings
in perl6 will *probably* be a mistake.

Ed
reply

Search Discussions

1 response

  • Bryan C . Warnock at Feb 21, 2001 at 1:31 am

    On Tuesday 20 February 2001 19:34, Edward Peschko wrote:

    Well, for one, your example is ill-considered. You are going to get
    autovivification saying:
    The two ideas were disjoint. The example wasn't an example of autoviv.
    Hence I'd say that @foo[$bar] has NO INTRINSIC VALUE whatsoever.
    Correct, which is why I could care less if Perl warns me about it.
    Second, with the keyword empty (if it comes to pass) the reasons for
    interpretation of undef as 0 and "" go away. Right now, things are a PITA
    to get empty values:

    my ($a, $b, $c, $d, $e) = ('') x 5;
    I *like* the interpretation of undef as 0 and "". It's useful. Sometimes.
    Sometimes it's not. And that's fine.
    With empty:

    my ($a, $b, $c, $d, $e) = empty;
    There's no reason in the world why that should replace undef -> 0 and "".
    I would rather say, and I think it would be more perlish to say, "I'm
    not
    feeling particularly perly today, can you check for anything clever,
    cause
    if there is, chances are it's a mistake."
    Or how about "I'm feeling particularly lazy today, I think I'll sleep in. Lets
    worry about any mistakes I might make another day."
    Well, Laziness is One of the Three.

    Let me rephrase.
    Perl shouldn't bitch at me for valid perl.
    For i maintain that any 'cleverness' that you might have that causes warnings
    in perl6 will *probably* be a mistake.
    Certainly, because it seems that all things inherently Perl are being
    removed from the language. :-(

    --
    Bryan C. Warnock
    bwarnock@capita.com

Related Discussions

Discussion Navigation
viewthread | post