AidanLee has asked for the wisdom of the Perl Monks concerning the following question:
hi all,
I've got a subroutine that uses a couple of eval's to determine where to store a certain piece of information. I've got a hash, $tmp_record and use a join to determine where in the bowels of that hash the value is stored. The variable storing the array for the path is complex, but here is the gist of it:
my $code_to_eval = ( defined $self->{$key}{path} ) ? '$tmp_record{' . join( '}{', (@{$self->{$key}{path} +},$key) ) . '} = $value' : '$tmp_record{'.$key.'} = $value'; #and then I run: eval $code_to_eval or warn @_;
If people are familiar with my ongoing postings, this relates to the ideas at the bottom of Re: Building and returning structured records from a query.
This works great and does exactly what i want to. This is why I was quite suprised when i found an error in my warning logs:
csResource::Registry=HASH(0x1a6f03c)
I'm running under strict and diagnostics. Any ideas what might be causing this? Thanks much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Eval errors though code is successful
by tadman (Prior) on Jul 09, 2001 at 07:46 UTC | |
by AidanLee (Chaplain) on Jul 09, 2001 at 16:13 UTC | |
|
Re: Eval errors though code is successful
by bikeNomad (Priest) on Jul 09, 2001 at 07:45 UTC | |
by AidanLee (Chaplain) on Jul 09, 2001 at 16:08 UTC |