Does anyone see a problem with doing something
as simple as this with form input.
Object is to create two hashes from one, one for printing back to
client safely (encoded) and the other to store the data in original non-encoded format.
=================================
my %in_c = %in; # copy my hash
foreach $key (keys %in) {
$in{$key}=encode_entities($value=$in{$key});
}
=================================
So now I have two hashes;
%in (encoded)
%in_c (decoded/raw)
The idea since I have many print statements through out
the program is to use %in for printing and to save %in_c for our internal use.
Seems to work and better to do at beginning of program and be done with it then to encode/decode multi times through the program.
Bad/Good/OK?
as simple as this with form input.
Object is to create two hashes from one, one for printing back to
client safely (encoded) and the other to store the data in original non-encoded format.
=================================
my %in_c = %in; # copy my hash
foreach $key (keys %in) {
$in{$key}=encode_entities($value=$in{$key});
}
=================================
So now I have two hashes;
%in (encoded)
%in_c (decoded/raw)
The idea since I have many print statements through out
the program is to use %in for printing and to save %in_c for our internal use.
Seems to work and better to do at beginning of program and be done with it then to encode/decode multi times through the program.
Bad/Good/OK?