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

Thanks -- (stupidity question - what's a pragma? required library?) At this point the software isn't ready for production. (I recently ran h2xs and made a simple test routine that says the equivilent 'hi world'.)

----
Zak
  • Comment on Re: Re: comp.lang.perl.modules & new module comments

Replies are listed 'Best First'.
Re: Re: Re: comp.lang.perl.modules & new module comments
by Sweeper (Pilgrim) on Oct 25, 2001 at 00:30 UTC
    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.
      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