Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^5: how to create a constant file and use it in other file

by sgifford (Prior)
on Jul 16, 2008 at 02:36 UTC ( #697844=note: print w/replies, xml ) Need Help??

in reply to Re^4: how to create a constant file and use it in other file
in thread how to create a constant file and use it in other file

See the documentation for Exporter. Basically anything you list in @EXPORT_OK will be available for import by name into other modules which use the exporting module, and anything you list in @EXPORT will be imported automatically into useing modules. It's generally considered better style to use @EXPORT_OK, or to use a named tag in %EXPORT_TAGS, but if the whole purpose of your module is to provide constants @EXPORT may be OK.

Your module might look something like this:

package MyConst; use warnings; use strict; use base 'Exporter'; use vars qw(@EXPORT_OK %EXPORT_TAGS); @EXPORT_OK = qw($const1); %EXPORT_TAGS = (all => \@EXPORT_OK); # ...

And the module using it would begin like this:

use MyConst qw(:all);

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://697844]
[Discipulus]: what i want is to compute them
[oiskuu]: You want to draw the path? $iter = combinations( $TOP_HEIGHT .. $NODE_HEIGHT, $pos); then get the path from the iter, level change at depth x, for(..) $pos += $level_change; something like that
[oiskuu]: yergh, <code> tags... [$top_height .. $node_height]
[Eily]: Discipulus by demonstrate I suppose you mean simulate with perl?

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2018-03-19 11:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.