Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Illegal subroutine

by rgiskard (Hermit)
on Oct 25, 2011 at 04:37 UTC ( #933529=note: print w/ replies, xml ) Need Help??


in reply to Re: Illegal subroutine
in thread Illegal subroutine

Do read perlsub if you meant to make a function. There are math examples you may emulate within perlsub (just search for the string "cube_root" within perlsub to get a feel for what you're trying to accomplish).

FWIW,if you were not trying to create a function, and instead merely set a variable to calculate profit you would have the following (note: I changed the equation a lot):

my $net = 123.456; my $coffee_allowance = 100.00; my $profit = ( $net - $coffee_allowance ); my $step_three = $profit; print "profit = $step_three \n";
(minor code updates)


Comment on Re^2: Illegal subroutine
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2015-07-02 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls