So if the user inputs H22011C12 it would give me H 22 0 11 C 12 all seperate so my next step is to pass that array into a subroutine. I know I have to multiply the weight of the symbol by the occurrence so if the weight of H is 12.01 I multiply by 22 and so on than I add all the totals I just can't seem to figure out how to start my subroutine I have a weights file goes with this. I was just hoping so one could give me some guidence or explain the process to me Thank you so much.Print "enter a formula.\n"; chomp ($form=<STDIN>); @array = $form =~ /[A-Z][a-z]?|\d+/ig
In reply to Formula program by perlguru22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |