A strange problem here. Perl is telling me
"Use of uninitialized value $_[2] in pattern match (m//) at Plugin/Syn +tax.pm line 39."
But there is no reference to $_[2] in the code. I stripped out most of the module to hit the function: (Line 39 is the first line of parse_rvalue())
package Plugin::Syntax; use strict; use warnings; use Data::Dump; my $code; my $kw = qr/[A-Za-z_][A-Za-z0-9_-]*/; my %directives = map { $_ => 1 } (qw| !some !data !snipped| ); my %commands = map { $_ => 1 } (qw| some data snipped| ); sub parse_command { return unless $_[0] =~ /\G\s*($kw)\s*=\s*/cg; # not 'ident =' my $id = $1; my ($s,$e) = ($-[1],$+[1]); if( $id =~ /^(?:ok|e[0-9A-Fa-f]{2})$/ ) { $code->tagAdd( 'special', "$_[1] +${s}c", "$_[1] +${e}c" ); } if( $_[0] =~ /\G($kw)\s*\(/cg ) { # parse that command pos( $_[0] )--; # give back the paren if( exists $commands{lc $1} ) { # Check if command exi +sts $code->tagAdd( 'command', "$_[1] +$-[1]c", "$_[1] +$+[1]c" + ); } return lc $1; } # This must be an immediate value &parse_rvalue; return 'none'; } sub parse_rvalue { if( $_[0] =~ /\G[CS]?\d\d-\d\d(?:\s+var\s+[0-9A-Fa-f]{1,2})?/cg ) +{ $code->tagAdd('constant', "$_[1] +$-[0]c", "$_[1] +$+[0]c"); } elsif( $_[0] =~ /\G[CS]?[#][0-9A-Fa-f]{3}/cg ) { $code->tagAdd('constant', "$_[1] +$-[0]c", "$_[1] +$+[0]c"); } elsif( $_[0] =~ /\G\$?[0-9A-Fa-f][0-9A-Fa-f ]*(?!\w)/cg ) { $code->tagAdd('constant', "$_[1] +$-[0]c", "$_[1] +$+[0]c"); } elsif( $_[0] =~ /\G\$?$kw/cg ) { # indentifier, no highlight } elsif( $_[0] =~ /\G".*?"/cg ) { $code->tagAdd('constant', "$_[1] +$-[0]c +1c", "$_[1] +$+[0]c +-1c"); } elsif( $_[0] =~ /\G\@[^\s,)]*/cg ) { $code->tagAdd('constant', "$_[1] +$-[0]c +1c", "$_[1] +$+[0]c" +); } elsif( $_[2] =~ /^(?: hsm | cat | cat8 )$/x and $_[0] =~ /\G[<>;]/ +cg ) { } else { return; } return 1; } 1;
And the test script:
use strict; use warnings; use Plugin::Syntax; Plugin::Syntax::parse_command( "xx = ", "" );

In reply to Weird undefined variable warning by JStrom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.