You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ask Bjoern Hansen <as...@develooper.com> on 2003/03/02 04:28:37 UTC

Re: [mp2] what is and why is it my log?

On Thu, 20 Feb 2003, Nick Tonkin wrote:

> > >>In my logs when dumping a warn() I see this occasionally:
> > >>
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28, <GEN1> line 245.

It's a perl feature.  On warn's it'll add the filehandle and the
line number when it's relevant.

5.6.1:

$ ~perl/bin/perl -e 'warn "foo"; open F, ".bashrc"; warn "Foo" while <F>' 2>&1 | head -5
foo at -e line 1.
Foo at -e line 1, <F> line 1.
Foo at -e line 1, <F> line 2.
Foo at -e line 1, <F> line 3.
Foo at -e line 1, <F> line 4.

If you set $/ so it's not reading normal lines it'll say chunk
instead of line:

$ ~perl/bin/perl -e 'warn "foo"; $/ = undef; open F, ".bashrc"; warn "Foo" while <F>' 2>&1 | head -5
foo at -e line 1.
Foo at -e line 1, <F> chunk 1.


Older perl's always said "chunk".

perl 5.5.3:

$ perl -e 'warn "foo"; open F, ".bashrc"; warn "Foo" while <F>' 2>&1 | head -5
foo at -e line 1.
Foo at -e line 1, <F> chunk 1.
Foo at -e line 1, <F> chunk 2.
Foo at -e line 1, <F> chunk 3.
Foo at -e line 1, <F> chunk 4.

 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();