Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: order of strict and package

by DrZaius (Monk)
on Jun 01, 2001 at 19:15 UTC ( [id://84950]=note: print w/replies, xml ) Need Help??


in reply to order of strict and package

Generally, it is:
package PackageName; use strict; use warnings;
I think this has something to do with the package identifies the file, so it should be at the top. Although, multipackage files break this.

Also, if you mix up pragma and other modules by accident, symbols will be imported into MAIN and not __PACKAGE__.

For example:

use strict; use CGI qw/:standard/; package MyPackage;
That probably would be a bad thing as it wouldn't be obvious why CGI functions are being imported into your script's namespace.

Replies are listed 'Best First'.
Re: Re: order of strict and package
by needles (Acolyte) on Jun 01, 2001 at 19:50 UTC
    Oh, yeah. That symbol importing problem would get REAL ugly. : ) I hadn't even considered that.

    Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://84950]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-19 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found