Hi,
I am new to all this Perl stuff and am having a minor problem. Fact is, I am crap at regular expressions.
Here is an example of something I want to do, but cannot find the right combination of \/\/ or whatever to do it.
Here goes -
I have a variable that contains either \ or 0-9. If the variable is \ - do something, if 0,2,4,6,8 - do something else, if 1,3,5,7,9 - do something else.
I have tried matching the contents of the variable to an array containing these numbers without success, and am sure I am missing something. I also want to create something similar to a switch statement in 'C'. Is there anything similar in perl?
Nevertheless, I think perl is great and I will persevere...
Hope one of you guys can help, and have a Merry Christmas.
I am new to all this Perl stuff and am having a minor problem. Fact is, I am crap at regular expressions.
Here is an example of something I want to do, but cannot find the right combination of \/\/ or whatever to do it.
Here goes -
I have a variable that contains either \ or 0-9. If the variable is \ - do something, if 0,2,4,6,8 - do something else, if 1,3,5,7,9 - do something else.
I have tried matching the contents of the variable to an array containing these numbers without success, and am sure I am missing something. I also want to create something similar to a switch statement in 'C'. Is there anything similar in perl?
Nevertheless, I think perl is great and I will persevere...
Hope one of you guys can help, and have a Merry Christmas.