Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Medicine monthly prices by dose calculator

by chanio (Priest)
on Oct 24, 2005 at 23:50 UTC ( #502603=note: print w/ replies, xml ) Need Help??


in reply to Re: Medicine monthly prices by dose calculator
in thread Medicine monthly prices by dose calculator

Thank you QM for your suggestions. They are now, listed for others to consider them...

About passing the input file on the command line, it would be an interesting issue since I would then need to use the <STDIN> diamond to ask for the quantities. If not, it would mess with the previous <> input ...

I wouldn't ever change the medicine's standard units, since they are not part of the script. (They are part of life's script and are only restricted to the doctors that prescribed them: it is not the same to build a house with one mason during 30 days or building it with 30 masons in one day)

It is a one-liner, because I wouldn't bother filing it as another script. But it is useful. I'll consider the -n option, promised!


Comment on Re^2: Medicine monthly prices by dose calculator
Re^3: Medicine monthly prices by dose calculator
by QM (Vicar) on Oct 25, 2005 at 03:05 UTC
    It is a one-liner, because I wouldn't bother filing it as another script.
    I don't know what system you're using, but most systems I know of would allow you to run the script directly, without invoking perl first. One of the more difficult ones to figure out on your own is Windoze -- you need help from ASSOC and FTYPE:

    ####################################

    ####################################

    Here's your code reformatted:

    About passing the input file on the command line, it would be an interesting issue since I would then need to use the <STDIN> diamond to ask for the quantities. If not, it would mess with the previous <> input ...
    Perhaps you just need to experiment more! Put the following in a file, and pass a text file on the command line:
    #!/your/perl/here use strict; use warnings; while (<>) { print "one: $_"; } print "\n\n: now reading from STDIN: \n\n"; print "Enter data: "; while (<>) { print "two: $_"; print "Enter data: "; }
    I think you missed my point about quantities, etc. If the doctor prescribes 2 pills per dose, 5 times/day, containing 200mg of pleonasm, and you can buy 200mg pills for 10 cents each, then it costs you $1.00/day. But if you can get 400mg pills for 15 cents each, it only costs 75 cents/day.

    I'm suggesting that some medications come in different pill concentrations, and you might save money by shopping around. And you might program that by using a file for the prescribed doses, and another file for the concentration/price tables.

    Now, I've left something out. You could do this by passing 2 files on the command line, and making judicious use of the continue and eof elements. Just check out eof for more details.

    Cheers,

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2014-07-29 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (213 votes), past polls