mpennucci has asked for the wisdom of the Perl Monks concerning the following question:
and converts them into Perl variables (array ref, hash ref, and scalar respectively) using an eval statement. When I tried to update the code to allow for scalar references (which would immediately get converted into a scalar), it started to core dump on me. I have included the offensive code below, stripped down to what appears to be its barest elements. Essentially I have a string, which gets turned into a Scalar reference when I eval it, which I then try to assign back into the same value. If I do a Scalar assignment, it blows up. If I do a list assignment, it works just fine.stored_proc_list => [ 'sproc1', 'sproc2', 'sproc3' ] update_stats_xref => { 'sproc2' => 'update_table2' } logfile => somefile.txt
Thanks for any insight,my $temp_value = q(\'/Path/to/log.txt'); my $value = eval $temp_value; # This one results in no value for $value and coredumps $value = $$value; print "New \$value = $value\n"; # This one does what I want it to do ( $value ) = ( $$value ); print "New \$value = $value\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bizarre References Question
by steves (Curate) on Feb 14, 2002 at 20:22 UTC | |
|
(Zaxo) Re: Bizarre References Question
by Zaxo (Archbishop) on Feb 15, 2002 at 04:46 UTC | |
|
Re: Bizarre References Question
by blakem (Monsignor) on Feb 14, 2002 at 20:22 UTC | |
|
Re (tilly) 1: Bizarre References Question
by tilly (Archbishop) on Feb 15, 2002 at 03:27 UTC | |
|
Re: Bizarre References Question
by abaxaba (Hermit) on Feb 14, 2002 at 20:13 UTC | |
|
Re: Bizarre References Question
by particle (Vicar) on Feb 15, 2002 at 04:06 UTC | |
|
Re: Bizarre References Question
by Anonymous Monk on Feb 15, 2002 at 01:32 UTC | |
by demerphq (Chancellor) on Feb 15, 2002 at 17:15 UTC | |
|
Re: Bizarre References Question
by demerphq (Chancellor) on Feb 15, 2002 at 17:19 UTC |