Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by LanX (Bishop)
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'.
Re^5: solve cubic equations (Perl & "looks like math")
by Anonymous Monk on May 05, 2017 at 16:02 UTC
    I would fire you for writing code like that. Unnecessary layers of having to align variables to functions. You sir, are a grade A jerk.
      "...I would fire you..."

      OK, Donald. And a happy weekend at Mar-a-Lago.

      «The Crux of the Biscuit is the Apostrophe»

      Furthermore I consider that Donald Trump must be impeached as soon as possible

        It's funny how you try to defend each other. That was horrible code and you know it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1189533]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2017-12-11 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (286 votes). Check out past polls.

    Notices?