Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: solve cubic equations (Perl & "looks like math")

by LanX (Sage)
on May 04, 2017 at 23:16 UTC ( #1189533=note: print w/replies, xml ) Need Help??


in reply to Re^3: solve cubic equations (Python)
in thread solve cubic equations

> > "Your code is basically the same, except that it doesn't have any dollar signs or semicolons."

> Precisely why it looks more like MATHS. :)

You don't like sigils?

Try this

use strict; use warnings; $,="\t"; my ($a,$b,$c); sub A() :lvalue { $a }; sub B() :lvalue { $b }; sub C() :lvalue { $c }; A = 1; B = A + 1; C = A + B; print A, B, C, B**3, sqrt(B);

1    2    3    8    1.4142135623731

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2022-01-26 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?