467,166 Members | 1,116 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,166 developers. It's quick & easy.

what is "Quantifier follows nothing before HERE mark in regex m/* << HERE / "?

Hi All,

I am getting the following warning while running the perl script

Warning is:

Quantifier follows nothing before HERE mark in regex m/* << HERE /

Expand|Select|Wrap|Line Numbers
  1.  
  2. foreach(keys %hash) 
  3. {
  4.  
  5.     if($_ =~ /$arr[0]/)    // Here I am getting the above warning
  6.     {
  7.          $team = $hash{$myKeys[0]};
  8.  
  9.      }
  10.     else
  11.     {
  12.        $team = $hash{$myKeys[1]};
  13.    }
  14. last;
  15. }
  16.  
I am comparing the arr[0] with the first key.Why I am getting this?
can anybody help me?

Regards,
Bhavani
Oct 16 '07 #1
  • viewed: 11191
Share:
2 Replies
KevinADC
Expert 2GB
$arr[0] has an asterisk at the beginning which is interpreted as a quantifier inside of a regexp. Use \Q...\E to escape meta characters in the string:

if ($_ =~ /\Q$arr[0]\E/)

see if that helps.
Oct 16 '07 #2
Thankyou Kevin.
now It is working fine.
Oct 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Eric A. Forgy | last post: by
1 post views Thread by Christian Schmidbauer | last post: by
2 posts views Thread by Jeff Jarrell | last post: by
3 posts views Thread by Efi | last post: by
16 posts views Thread by Mark Chambers | last post: by
3 posts views Thread by chemicalcold0@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.