in reply to Re: Re: comp.lang.perl.modules & new module comments
in thread comp.lang.perl.modules & new module comments

Short name pragma, long name pragmatic module.

These are modules which change the behaviour of the Perl interpreter. For example:
use integer;
change arithmetic operations, (division and the like) so the results are integers. e.g.

print 5 / 2;
use integer;
print 5 / 2;
will print 2.5 and then 2.

And there are the two paragmatic modules you should always use, until you feel confident with Perl:

use warnings;
use strict;
These two pragmas will help you find your logic errors and dubious constructs.

Unlike normal modules, pragmatic modules last until the closing parenthesis (or more acurately, until the end of the enclosing scope). Or you can explicitely revoke them with

no integer;
See Programming Perl page 136, and chapter 31.
  • Comment on Re: Re: Re: comp.lang.perl.modules & new module comments

Replies are listed 'Best First'.
Re: Re: Re: Re: comp.lang.perl.modules & new module comments
by zakzebrowski (Curate) on Nov 05, 2001 at 21:11 UTC
    Cool. The one annoyance I have with the way perl monks was designed, if a user has the same name as the term you are looking for (eg: pragma) the search returns only the user's node. Thanks.

    ----
    Zak