Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello Monks,
I have been working on a rather basic script in Perl (using the CGI.pm module), and am combining it with Ajax.
The problem is in my parsing abilities, which I am trying to handle completely in Perl, rather than in the javascript form validation with my Ajax.
The Code is have so far is as follows:
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! CalebIn reply to Splitting multiple commands with regex failure by CalebH
|
|