develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)

From:
Cliff Rayman
Date:
March 31, 2000 11:04
Subject:
Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)
Message ID:
38E4F6AA.D0FB0CA8@spamless.genwax.com
Seems to me there is a book in here somewhere:

"Learning and Testing Perl with One Liners"

does anyone know any perl authors?

cliff rayman
genwax.com

Tom Christiansen wrote:

> I don't think you want to start down this path.  We have a compiler.
> It does things for you.  You have to learn this.
>
>     % perl -e 'if(0) { 1; FRED: 2; 3 } goto FRED'
>     Can't find label FRED at -e line 1.
>
> Huh, what do you mean you can't find the label?  It's right there!
> What a stupid compiler.
>
>     % perl -MO=Deparse -e 'if(0) { 1; FRED: 2; 3 } goto FRED'
>     '???';
>     goto FRED;
>
> or this one:
>
>     % perl -MO=Deparse -e 'if (1) { print "now" } else { print "then" }'
>     print 'now';;
>     -e syntax OK
>
> or this one:
>
>     % perl -ce 'if (eval { sqrt(-10); 1 } ) { print "ok" } '
>     Can't take sqrt of -10 at -e line 1.
>
> or this:
>
>     % perl -e 'sub neg10() { -10 } if (eval { sqrt neg10(); 1 } ) { print "ok" } '
>     Can't take sqrt of -10 at -e line 1.
>
> Lok at that, it's compile-only, and it still copmlains.  I never
> told the compiler to take the sqrt of -10.  I said to take it of neg10().
> Er, didn't I?
>
> Again, are you *REALLY* sure you want to go down this road and
> unravel all the things the compiler and do and then say which will
> confuse the ignorant?   Isn't it better to cure ignorance -- or,
> failing that, simply ignore them?
>
> --tom




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About