Hmm thanks for the reply but I'm not sure I understand how this will work.
The regular expression held in $exp looks like this
(?-xism:(?ig:(?:create table ([a-z]|[_])+(?{$self->{m}=1})|insert \b([
+a-z]|[_])+\b (?{$self->{m}=3})|lock table(?{$self->{m}=0})|grant(?{$s
+elf->{m}=2}))))
If I understand your answer correctly (it's highly plausible that I don't !) you are suggesting that I split the line based on this regex ?
So that makes the suggested code look like this ?
my @parts = split /(?=(?-xism:(?ig:(?:create table ([a-z]|[_])+(?{$sel
+f->{m}=1})|insert \b([a-z]|[_])+\b (?{$self->{m}=3})|lock table(?{$se
+lf->{m}=0})|grant(?{$self->{m}=2})))))/, $text;
I'm only just past novice stage with Perl but that doesn't look right to me ?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.