Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re (tilly) 1: order of strict and package

by tilly (Archbishop)
on Jun 01, 2001 at 20:29 UTC ( [id://84981]=note: print w/replies, xml ) Need Help??


in reply to order of strict and package

I tend to break strict in the header. So I write it like this:
package Packagename; use Exporter; @EXPORT_OK = qw(foo bar); @ISA='Exporter'; use strict; # etc
Note that I am still working on 5.005_03 so I don't use warnings. (And I won't use our even after upgrading, but that is another story.)

Replies are listed 'Best First'.
Re: Re (tilly) 1: order of strict and package
by Sifmole (Chaplain) on Jun 01, 2001 at 21:29 UTC
    Tilly, Why do you "break strict" in your header?

    I tend to do the following, and am wondering if I am doing something wrong...

    package Foo; use strict; use Exporter; use vars qw(@EXPORT_OK @ISA $foo $bar); @ISA = qw(Exporter); @EXPORT_OK = qw($foo $bar);
      I used to do that as well. I changed because it is less typing and as a way of hinting that @ISA and @EXPORT_OK are not to be assigned to within the module. YMMV.
Re: Re (tilly) 1: order of strict and package
by John M. Dlugosz (Monsignor) on Jun 01, 2001 at 21:58 UTC
    That used to bother me, too. use vars came along, and then the our keyword fixes the problem. Care to tell us (on another thread, if need be) what you find wrong with our "even after upgrading"?
      I already explained at Why is 'our' good?. Basically there is nothing that our does that I don't think can be done better another way.

      Beyond that I avoid introducing gratuitous backwards compatibility issues unless I see a significant gain from the new feature. I simply do not see that in our.

Log In?
Username:
Password:

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

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

    No recent polls found