Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 ?

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988984]
help
Chatterbox?
[choroba]: Good morning!
[Corion]: I hope you had a good weekend!
[marto]: jetlag has really done a number on the kids, it's been a tough week
choroba played with the band on Saturday, so Sunday was very sleepy
[choroba]: managed to release Syntax::Construct with 5.28 support in the night, though
[Corion]: choroba: Whee ;)
[Corion]: marto: Ouch - I would've thought that kids adapt much better, but that's obviously not the case...
[marto]: well, their mother let them sleep till 15:00 & 12:00 last week, which didn't help them adjust :P
[Corion]: I was "productive" over the weekend in the sense that I revived my old "Perlmonks on SQLite" code, which likely means I can get a test instance back up running on my webhost. Small steps :)
[Corion]: marto: Ow, no, that doesn't help at all :)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2018-06-25 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?