This looks surprisingly like another question asked here yesterday. Homework assignment?
As for the questions ...
- To "undef a variable", you simply undef $foo;. The rest of your first question indicates that you don't really understand what you're asking. Think about it further - what exactly do you want to do? If you don't know, then nothing I say can help you.
- Swapping a character for another character is called transliteration. Perl uses an operator called tr. Click on the hyperlink for more information.
------ We are the carpenters and bricklayers of the Information Age. Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement. | [reply] [d/l] |
As dragonchild said this sounds a bit like homework and if it is it wouldn't be really fair to give you the answer :). But heres a hint.
If I understand you correctly you want to get rid of the SYMM part form the line. For that you probably want to use regular expressions. Look into the 's' (switch) operator. And follow dragonchild's suggestion on reversing the signs.
Hope that helps.
Chris
Update: That should be 's' for the substitution operator. I was still asleep when I wrote this :). (Thanks to premchai21 for pointing that out)
| [reply] [d/l] |