For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > February 2005 > Having a problem with a short pipe read









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Having a problem with a short pipe read
Brian

2005-02-23, 3:55 pm

I'm using the DBI module and along with a pipe read
(ie, my $line = <$handle> )

I populate a database table with the parsed results of $line.

the problem I'm having is that I'm getting some (not all) short reads
on the handle, meaning that's it's returning but not all the data is
there and there was no '\n' in the data that should have returned it.
A subsequent read ($line = <$handle> ) will get the remaining data.

I picked up this code from a former co-worker and he made mention in
the script of there being a problem with DBI and the pipe which he
tried to fis with undefinig and resetting $SIG{PIPE} around the open
call that set up the pipe, but that doesn't seem to do the trick.

Has anyone else seen this behavior before and know of any fixes?

Thanks,
Brian

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com