in reply to is 1; at the end of a PM still necessary in 5.6.1 ?

From permod it says:
"1;  # don't forget to return a true value from the file"
a subroutine is a true value ;-)

I don't remember this not working in prior versions.

What exactly is the value of a subroutine?it's always true, i know that much ;)

My test code worked on all my ActivePerl and IndigoPerl installations, as well as, jcwren's machine.

package test2; require Exporter; use vars qw/@ISA/; @ISA = qw(Exporter); sub new { my $me = shift; return bless {},$me; } sub Ed_Guine { return -reverse oy}; __END__
and the test line: perl -Mtest2 -e"$_=new test2;print $_->Ed_Guine;"

update:
Apparently, what is happening is the return value is true, because @ISA = qw(Exporter); evaluates to true. I tested by inserting 0; in between the subs and such. MeowChow is right.

So, to avoid all this confusion, just make sure you have 1; before __DATA__ (or __END__ depending on what you use).

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Replies are listed 'Best First'.
Re: (crazyinsomniac) Re: is 1; at the end of a PM still necessary in 5.6.1 ?
by John M. Dlugosz (Monsignor) on Jul 22, 2001 at 09:22 UTC
    So why did it work just fine when I did forget?