Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: getting syntex error in pattern search

by SerZKO (Beadle)
on Aug 22, 2012 at 09:19 UTC ( #988984=note: print w/replies, xml ) Need Help??

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 (Bishop) 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 :-) .

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988984]
and the leaves swirl about...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2018-04-22 17:33 GMT
Find Nodes?
    Voting Booth?