Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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 ?


Comment on Re: getting syntex error in pattern search
Download Code
Re^2: getting syntex error in pattern search
by choroba (Abbot) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-08-01 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls