Bearing in mind the possible homework nature of this question and going on mostly blind optimism that he really does want some tips and not a solution:
- Use split to seperate the words. You probably want to split on a space and then disregard punctuation somehow, either delete it entirely or remove it and then restore at the end
- foreach word in the list you got from split, use substr to find the first letter
- You can then append data by using either the contecate operator: . or just double quotes in the form: $variable="${variable}new_data";, but this case is tailor made for using the appending form of the contecate operator
- Assemble the list of words back together again, restore punctuation and you have yer sentence.
| [reply] [d/l] |
| [reply] |
Break your problem down into parts. It is easier to defeat a problem piece by piece. At this point, we don't know if you even know how to run a Perl program. | [reply] |
I hate to say it, but I caught in the chatterbox that this a homework assignment... I wonder how other monks feel about doing someone's homework for them.
I'll save the "teach a man to fish" speach, as it's been covered pretty well recently. On top of that, though, is the moral issue of doing someone's homework for them.
I used to teach beginner-level programming classes (among other things), and the very thought that someone would turn to a site like this, in the middle of the night, to have their homework (probably due at 8:30 tomorrow morning) done for them... well, it just makes me kind of sad. You know, you've probably got a TA somewhere who'd have been more than happy to work through this problem with you, and you'd have certainly learned more.
------------
:Wq
Not an editor command: Wq
| [reply] |
| [reply] |
| [reply] |