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

Re: Why to wrap Perl classes inside a Perl script into blocks

by Eily (Monsignor)
on Jun 01, 2015 at 17:05 UTC ( [id://1128603]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package First;
    our $var = 1;
    
    package Second;
    $var++;
    print $First::var;
    
  2. or download this
    package First
    {
      our $var = 1;
    ...
      $var++; #doesn't work under strict
      print $First::var;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found