Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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 (Chancellor) 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 web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2016-10-21 10:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (288 votes). Check out past polls.