James Edward Gray II wrote:

> On Feb 23, 2004, at 10:35 AM, James Edward Gray II wrote:
> 
>> I believe I have a solution now.  I'm going to try switching the way
>> the system works to eval() to a hash reference, instead of a hash.  I
>> expect that to silence the two original warnings caused by the undef
>> being returned.
> 
> More egg on my face, this didn't change a thing!
> 
> I reverted to something like the original snippet and changed the
> system to produce hash references, instead of hash lists:
> 
> my $details = eval $replacements{ACTION_DETAILS};
> if ($@) {
> # tell me about the error...
> }

>> ($replacements{ACTION_DETAILS} is supposed to eval() to a hash 
>> initializing list, naturally.)

i am having a hard time understand what the above mean. does it mean 
$replacements{ACTION_DETAILS} returns a hash, hash reference, list, or code 
string? Or does it mean eval is suppose to return those? the reason why i 
am asking is the following:

#!/usr/bin/perl -w
use strict;

my $i;

my %h = ('$i = ' => 1);

eval %h;

print $@ if($@);

print "$i\n";

__END__

doesn't do what you might expect it to do:

Use of uninitialized value in concatenation (.) at tmp2.pl line 12.

the following, however, does:

#!/usr/bin/perl -w
use strict;

my $i;

my %h = ('$i = ' => 1);

eval join "",%h;

print $@ if($@);

print "$i\n";

__END__

prints:

1

david
-- 
sub'_{print"@_ ";* \ = * __ ,\ & \}
sub'__{print"@_ ";* \ = * ___ ,\ & \}
sub'___{print"@_ ";* \ = * ____ ,\ & \}
sub'____{print"@_,\n"}&{_+Just}(another)->(Perl)->(Hacker)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to