Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Loading a function from another file dynamically?!

by gmax (Abbot)
on Mar 23, 2003 at 19:07 UTC ( [id://245302]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        do $filename;
        eval $sub;
    }
    
  2. or download this
    #cat other.pl
    
    sub hello {
        print "hello world\n";
    }
    
  3. or download this
    # cat other2.pl
    sub hi {
        print "hi, world!\n";
    }
    
  4. or download this
    $ perl test_runtime.pl 1 other.pl hello
    
  5. or download this
    $ perl test_runtime.pl 2 other2.pl hi
    $ perl test_runtime.pl 3 other2.pl hi
    
  6. or download this
     _  _ _  _  
    (_|| | |(_|><
     _|
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-24 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found