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

Re^2: require a module and import array data

by fionbarr (Friar)
on Apr 09, 2015 at 14:40 UTC ( [id://1122939]=note: print w/replies, xml ) Need Help??


in reply to Re: require a module and import array data
in thread require a module and import array data

########################################################## # db_data.pm use strict; use warnings; package db_data; use Exporter; my @ISA = qw(Exporter); my @EXPORT = qw(@LoH); my @LoH = ( { database => 'Pxxxxx', hostname => 'wpprd0.com', servicename => 'pqxxxx', port => '9010', username => 'mmmmmm', password => 'pl', }, ) ; 1;
@LoH array is still not available to main routine

Replies are listed 'Best First'.
Re^3: require a module and import array data
by Corion (Patriarch) on Apr 09, 2015 at 14:49 UTC

    So, have you read the other link I provided?

    Alternatively, have you read the Exporter documentation and examples? They do not mention lexical variables, neither for @EXPORT nor for the exported variables. Maybe you want to explain why you chose to use lexical variables there.

      from Exporter 'The symbols can represent functions, scalars, arrays, hashes, or typeglobs'

        from Exporter 'The symbols can represent functions, scalars, arrays, hashes, or typeglobs'

        And then what happened?

        my @EXPORT isn't going to work, ever

      I can't access the other link....company is blocking that URL

        Then maybe you can go to an internet cafe, open the link there and print it out.

Re^3: require a module and import array data
by Anonymous Monk on Apr 09, 2015 at 14:47 UTC

    Take a closer look at Exporter, my isn't used for any of the vars , they are supposed to be globals ... my vars (not globals) cannot be exported

      got it! Thanks...it was the lexical 'my' @LoH in the db_data module

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found