in reply to Re: why do some perl files end with 1;
in thread why do some perl files end with 1;

Module authors have the opportunity to use a string in this position. They could say

It's like a comment, except if the user deletes it, their program breaks.

Some CPAN authors do use this opportunity to have a last word. Does anybody have a favorite example?

Replies are listed 'Best First'.
Re^3: why do some perl files end with 1;
by ferreira (Chaplain) on Feb 22, 2008 at 12:25 UTC
    Some good ones.
    • Explicit and correct: from List::Maker
      1; # Magic true value required at end of module
    • Epitaph: at Acme::DonMartin
      'This module is dedicated to Don Martin' ; 1931-2000
    • Identify your package: from nuffin's packages:
      __PACKAGE__;
    • Remarkable quote: at WWW::CPAN
      "I didn't do it! -- Bart Simpson";
    • the end of Sex
Re^3: why do some perl files end with 1;
by John M. Dlugosz (Monsignor) on Feb 22, 2008 at 00:30 UTC
    Favorite example:

    return 1; # module loaded successfully