in reply to Re: Using Variables
in thread Unitialized value warnings with require
Storable is a more reliable way to store variables. From the Storable manpage:
use Storable; store \%table, 'file'; $hashref = retrieve('file');
or alternatively:
use Storable qw(nstore store_fd nstore_fd freeze thaw dclone); # Storing to and retrieving from an already opened file store_fd \@array, \*STDOUT; nstore_fd \%table, \*STDOUT; $aryref = fd_retrieve(\*SOCKET); $hashref = fd_retrieve(\*SOCKET);
Of course, if you need to include other things besides variables in the config, you may want to consider turning your code into a module
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Using Variables
by runrig (Abbot) on Dec 28, 2001 at 00:15 UTC | |
by chip (Curate) on Dec 28, 2001 at 01:04 UTC |