in reply to how do i put an equasion in a variable, one which is evaluated at the time of use?
Is this good enough?my $array = [ 5, 5 ]; $array->[2] = sub { $array->[0] * $array->[1] }; print &{$array->[2]}; # 25 $array->[1] = 10; print &{$array->[2]}; # 50
Update: You could also use eval:
$array->[2] = '$array->[0] * $array->[1]'; print eval $array->[2];
-- Casey
In Section
Seekers of Perl Wisdom