Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Understanding using external program data

by SheridanCat (Pilgrim)
on Feb 14, 2007 at 16:16 UTC ( #599976=note: print w/replies, xml ) Need Help??


in reply to Understanding using external program data

You should make lookup.pm a module and "use" it. Here's an example:
#!/usr/bin/perl use strict; use warnings; use Lookup; use Data::Dumper; print Dumper \%devel_table;
And then the Lookup.pm module (I usually capitalize modules):
package Lookup; use strict; use warnings; require Exporter; our @EXPORT = qw(%devel_table); our @ISA = qw(Exporter); our %devel_table = ("Townhomes West" => "M", #lots more values in here, of course "Winding Creek Family" => "H", "Dayton Lane Gardens" => "H"); 1;

Replies are listed 'Best First'.
Re^2: Understanding using external program data
by NovMonk (Chaplain) on Feb 14, 2007 at 16:25 UTC
    So, in the module, you Don't use the #! line-- you say "package <packagename>;". Such a simple thing, but I just couldn't see it. Everything works now. Thanks!
      Oh dear, that's a very superficial description of the situation.

      The "hashbang" line in a script and a "package" line in a module have very little in common. One is Perl, the other isn't, for one essential difference. Each can usefully appear in the other kind of file, so they're not even distinctive.

      Please read up on the function of each. See perldoc perlrun for the hashbang line and perldoc perlmod (plus perldoc -f package for the package statement.

      Anno

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-06-27 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (86 votes). Check out past polls.

    Notices?