Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: execute a string

by beech (Parson)
on May 04, 2016 at 07:39 UTC ( #1162154=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ cat ideone-6TneLv.pl
    #!/usr/bin/perl
    our @v;   # external values stack
    ...
    -2**4 = -16
    1+2+3+4+5+6+7+8+9+10 = 55
    
  2. or download this
    sub Calc {
        local($_) = @_;
        local @v = ();
    ...
        s/[\r\n]*//g; ## "chomp"
        print $_," = ", Calc($_), "\n"; 
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2020-05-26 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (152 votes). Check out past polls.

    Notices?