lol.
I realized what you meant and changed the program so it would die if not read. what I'm trying to work on now is the pattern matching. Upon reading my textbook I don't really think I need substitution. What I need my program to do is to recognize similar words with their numbers and add them together, otherwise look over the word (and associate number) but print them anyway.
($info=~ /(\w+ (-?\d+ )+)/)
That should match any word with its number, since \w is for word charters and \d is for numbers. + is for one or more of the same to match.. the and ? is so that the last number can still be counted. the dash in front of it is undefined to me by my text book.. (elements of programming with perl)
In reply to Re^6: A Beginner Needs Homework help
by Swizzlestix617
in thread A Beginner Needs Homework help
by Swizzlestix617
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |