Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Location of 'use' statements (mine)

by Aristotle (Chancellor)
on Apr 19, 2003 at 15:40 UTC ( #251673=note: print w/replies, xml ) Need Help??


in reply to Re: Location of 'use' statements (tye)
in thread Location of 'use' statements

This is very close to what I do. I think of strict and warnings as part of an extended shebang line. Exporter is ugly so I avoid it wherever possible; though when I use it, I tend not to treat it and its globals specially. Finally, I reserve require solely for deferred loading of modules. So I arrive at a layout like this:
#!/usr/bin/perl use strict; use warnings; package FooBar; use Some::OO::Module (); use Some::Function::Module qw( Func1 Func2 ); use base 'Quux'; use vars qw($VERSION); $VERSION= 1.001; use constant _IdNo => 0; use constant _Name => 1; use constant _Pos => 2;

Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://251673]
help
Chatterbox?
[choroba]: As discussed in Using the DATA file handle for ARGV, I usually start my "fun" scripts with *ARGV = *DATA{IO} unless @ARGV;
[choroba]: this was just a remainder
[Discipulus]: ah thanks i forgot that thread (even if i saved it in my homenode)..
[Discipulus]: the node i discovered yesterday nigth was also interesting

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2016-12-06 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.