Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: string functions

by Corion (Patriarch)
on Oct 25, 2006 at 09:31 UTC ( [id://580519]=note: print w/replies, xml ) Need Help??


in reply to Re^2: string functions
in thread string functions

If you need the product, why are you expanding your string at all? You should then be able to calculate your product by simply multiplying the letters by their factors in front. But if I interpret what you say that way, I still don't get your result:

perl -le "print 2*1.5*(50/100)*2*2.5*(55/100)*2*3.5*(60/100)" 17.325

Please explain what calculation you want to perform.

The structure of if..elsif is a very cumbersome way to approach your problem, so I doubt that tye recommended it as a solution for this specific problem.

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://580519]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found