Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^2: Tk save variables into a file and load

by afoken (Canon)
on Sep 15, 2018 at 20:38 UTC ( #1222451=note: print w/replies, xml ) Need Help??

in reply to Re: Tk save variables into a file and load
in thread Tk save variables into a file and load

I need help in perl Tk to save, load, default or change config variables, whenever i require. How do I approach.

One good way is to use Storable. It allows you to write an existing hash to a file, OR read the file back into a hash.

I would use Storable only for short-time data storage (i.e. temporary files that survive only for seconds up to hours) on a single machine. Here is why: Re: Perl Storable problem (i Think).

There are much better ways for long-time data storage and configuration files: Re: Accessing variables in an external hash without eval.

And for storing more than a few kBytes worth of data, perhaps across several machines, there is DBI and the various supported databases: Re^2: Perl and Database.


Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^2: Tk save variables into a file and load

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2020-10-29 00:00 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (265 votes). Check out past polls.