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

Re: [ID 20000403.009] uninitialised concatenation???

Thread Previous | Thread Next
Tom Christiansen
April 4, 2000 06:47
Re: [ID 20000403.009] uninitialised concatenation???
Message ID:
The opcodes that Perl compiles your program into ARE NOT THE ONES

There are a million cases of this.   Here are two:

    % perl -MO=Deparse -e 'for($i=0; $i<10; $i++){}'
    $i = 0;
    while ($i < 10) {
    continue {

Look, there's NO for loop there anymore!  My goodness, what a
terrible bug!   What are you going to do now, change that too?
Also, the postinc you wrote is NOT what Perl is going to execute.
It's a different opcode.  There are *plenty* of other cases like
this.  It's what the compiler is doing.  Here's another:

    % perl -MO=Deparse -ne '$seen{$_}++ && print'
    LINE: while (defined($_ = <ARGV>)) {
	print $_ if $seen{$_}++;

I NEVER SAID if.  But look at that!  And where did that LINE label
come from?  I never said that either.  Dang it, perl is broken.
What do you propose to do about these terrible errors, huh?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About