|Pathologically Eclectic Rubbish Lister|
Splitting multiple commands with regex failureby CalebH (Novice)
|on Aug 24, 2012 at 07:09 UTC||Need Help??|
CalebH has asked for the
wisdom of the Perl Monks concerning the following question:
The purpose of the script is to take a lot of input through a textarea, and split it based on various 'commands', all seperated by a !Command syntax. An example above is !book, but I also have !number and a few others, and various actions need to be performed based on the command type.
I am aware that I am missing the shebang line, but at the moment I am just running this script locally on my Windows machine and it's working as is, just not spitting out the results I want (It parses the first parameters, like "command=!book this is my test book !number 1222223 !book another book" will just split out "!book this is my test book", and ignore the rest.
What I would like to happen is to have the 'commands' pushed into an empty array, and use something such as Getopt::Param to parse them, or even getopt::long.
And as for why I am not using those to start with; I just wanted a simple way to do everything using one textarea and one param, and split it into multiples from that.
Thanks Monks, and apologies for the long winded first post!Caleb