in reply to Interesting SEEK behavior on tied filehandle

I noticed an interesting behavior with the READ function when you called read() on a tied filehandle. Since read() accepts 3 or 4 arguments, the code I was looking at (not mine) went something like:
sub READ { if ( @_ == 3 ) { # read into buffer } else { # read into buffer at offset }
It turned out that even if you called read() with 3 arguments, READ was always called with 4 arguments, and the 4th (the offset) was set to zero (which I admit makes sense, but it threw a warning about uninitialized value in substr in this particular case, and made the conditional pointless).