in reply to Re^2: search pattern not terminated
in thread search pattern not terminated

Where did the code come from? I presume (given the level of your questions) that this is not your own code. There are some rather unusual aspects to the code and if you are not a reasonably competent Perl programmer I suspect you will continue to have trouble with it.

For a start while () {...} is an unterminated loop, which is unlikely to be correct given that there is code following it.

The match giving you your immediate trouble is against the default variable ($_), but nothing assigns a value to it, hence it is uninitialized (the immediate error). But it is not at all clear what value should be assigned to it.


Perl is environmentally friendly - it saves trees

Replies are listed 'Best First'.
Re^4: search pattern not terminated
by habel_k (Initiate) on Jan 22, 2008 at 02:46 UTC
    yup....the code is a part of a tutorial and I am trying to built over it and of course this is my first attempt to fiddle with perl....Thanks for your help. The change that i had to make to get things work:
    while (<>) { if (my($ip,$date,$method,$url,$query,$protocol,$retcode,$byte)=($_=~ + m/$LOG_PATTERN/)) { print "IP :",$ip,"\n";} }