develooper Front page | perl.perl5.porters | Postings from February 2011

C<use autodie> unravels C<use strict>

Thread Next
Tom Christiansen
February 27, 2011 06:49
C<use autodie> unravels C<use strict>
Message ID:
Everything I touch today crumbles in my hands.

When you use autodie, you implicitly declare legal
any scalar variable whose name matches that of any
function it "fatalizes".

Here's a (partial) dump of %main:: during the compilation
and run of the enclosed program:

    BEFORE AUTODIE  => $0 @ARGV %ENV @INC %INC @_ &dump_main &func1 &funcU
    AFTER AUTODIE   => $0 @ARGV %DOES %ENV @INC %INC %SIG @_ &accept &bind &binmode &carp &chdir &close &closedir &confess &connect &croak &dbmclose &dbmopen &dump_main &fcntl &fileno &flock &fork &func1 &funcU &getsockopt &ioctl &link &listen &mkdir &msgctl &msgget &msgrcv &msgsnd &open &opendir &pipe &read &readlink &recv &rename &rmdir &seek &semctl &semget &semop &send &setsockopt &shmctl &shmget &shmread &shutdown &socketpair &symlink &sysopen &sysread &sysseek &syswrite &truncate &umask &unlink
    DONE COMPILING  => $0 @ARGV %DOES %ENV @INC %INC %SIG @_ &carp &confess &croak &dump_main &func1 &funcU
    BEGIN PROGRAM   => $0 @ARGV %DOES %ENV @INC %INC %SIG @_ &carp &confess &croak &dump_main &func1 &funcU
    END PROGRAM     => $0 @ARGV %DOES %ENV @INC %INC %SIG @_ &carp &confess &croak &dump_main $fork &func1 $func1 &funcU $funcU $open $pipe $read $recv $seek $send


Tested under v5.12.3, v5.13.9, and v5.13.10-33-g149d510.


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