in reply to getting syntex error in pattern search

If your code looked like this
open FILE,"config.txt" or die "cannot open file : $!"; while(<FILE>) { $ip = ($_ =~ m/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) print "$ip"; # print $_; }
where would you put semicolon ?

Replies are listed 'Best First'.
Re^2: getting syntex error in pattern search
by choroba (Cardinal) on Aug 22, 2012 at 09:34 UTC
    After line 3, of course. Have you tried running the code? Also, prepending some spaces to the lines in the loop would not harm anybody.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      No I haven't tried to run the code choroba. I've just tried to point ulaksh to the right direction when it comes to syntax :-) .