Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: how do i put an equasion in a variable

by cwest (Friar)
on Jun 29, 2000 at 23:06 UTC ( [id://20469]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $array = [ 5, 5 ];
    $array->[2] = sub { $array->[0] * $array->[1] };
    print &{$array->[2]}; # 25
    $array->[1] = 10;
    print &{$array->[2]}; # 50
    
  2. or download this
    $array->[2] = '$array->[0] * $array->[1]';
    print eval $array->[2];
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://20469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found