Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problem with functions in modules

by chanakya (Friar)
on Oct 27, 2005 at 07:00 UTC ( [id://503255]=note: print w/replies, xml ) Need Help??


in reply to Problem with functions in modules

Hi nisha, Below is a sample code that calls a ReadConfig() from the module. This should get you started in your work.
package Skywalker; require Exporter; @ISA = qw(Exporter); use strict; our @EXPORT = qw(ReadConfig); sub ReadConfig { my ($file) = shift; warn " --- going to read config file: $file ---\n"; # more steps here } 1;
now the calling file itself
#!/usr/bin/perl use warnings; use strict; use Skywalker; ReadConfig('/tmp/simple.cfg');
output:
perl walktest.pl --- going to read config file: /tmp/simple.cfg ---
Hope this helps. Good luck

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-03-28 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found