Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Strange error dumping tainted data

by Stevie-O (Friar)
on Mar 24, 2005 at 03:48 UTC ( #441951=note: print w/ replies, xml ) Need Help??


in reply to Strange error dumping tainted data

I think you need to try another approach.

Instead of using an 'S' namespace, try putting all the variables you need to save into a global hash (%::S will do).

use Storable; $S{scalar} = 5; @{$S{array}} = (5, 6, 7, 8); %{$S{hash}} = (hi => 1, there => 2); Storable::store \%S, 'state.sav'; %S = %{ Storable::retrieve('state.sav') };
(Note that for the purposes of saving and restoring variables, Storable has a number of advantages over Data::Dumper.)
--Stevie-O
$"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc


Comment on Re: Strange error dumping tainted data
Select or Download Code
Replies are listed 'Best First'.
Re^2: Strange error dumping tainted data
by zealot (Sexton) on Mar 24, 2005 at 22:30 UTC

    I am curious as to why you would suggest using a hash instead of a namespace. Is there a performance or security reason for changing it, or is it just a personal preference thing? There is a great deal of code already written using this method, so I wouldn't want to change it without cause. However, if there is a reason that it should be changed, I would definitly like to know! I was able to find a work-around, so my implementation is functional.

    I decided to use Data::Dumper instead of Storable for a couple of reasons. With another project, I had to rebuilt a lot of data after upgrading to a newer release of Perl that was not backwards compatible with the preious version of Storable. Also, I occasionally need to view and edit the information stored, and that is just easier with code that has been dumped.

    Thank you for the reply!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2015-07-29 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (261 votes), past polls