Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: 'require/use' scoping

by brian_d_foy (Abbot)
on Jan 29, 2008 at 15:26 UTC ( #664910=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Foo;
    
    ...
        require Foo;
        Foo->import;
        }
    
  2. or download this
    use MODULE qw(import list);
    
    ...
        require MODULE;
        MODULE->import(import list);
        }
    
  3. or download this
    use MODULE ();
    
    BEGIN {
        require MODULE;
        }
    
  4. or download this
    require "lib/Foo.pm"; # no @INC searching!
    
  5. or download this
    sub require {
      my ($filename) = @_;
    ...
          return $result;
      }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://664910]
help
Chatterbox?
[Lady_Aleena]: Discipulus, do glob recurse?
[Lady_Aleena]: s/do/does/;
LanX wants to be fired
[Discipulus]: i fear no
[Discipulus]: i invented also 'gired'
[Lady_Aleena]: Discipulus, then that is a problem. I wanted to find total seconds of my entire .mp3 collection to do some math on it to see how many days of continuous music i have.
[LanX]: darn. .. I wanted to see Marine and Melonchon go to next round, just for fun xD
[Discipulus]: LA use Perl: traversing a dir tree is simple; foreach file mp3 $sec+= use Mp3::Info
[Lady_Aleena]: Discipulus, I was able to get the sum of the seconds on the command line using awk. Then I ran the result through a perl script and got the result. It came bach with 4 days, 9 hours, 56 minutes, 43 seconds.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2017-04-23 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.