If ur just trying to pull data from websites I would highly recommend LWP or
WWW-Mechanize.  No need to reinvent any wheels.  If this is just a
demonstration and ur trying to do something else, what u need here is
nonblocking read.  As u accumulate more of the response u can inspect it to
see when to expect the end.  Check out Fnctl to put the filehandle into
nonblocking mode.  U then go into a read loop and check the return value of
read().  

Unfortunately Fnctl is broken on Windows.  U may have to use Cygwin.  Jan?


At 04:36 PM 4/21/2009 -0700, gai...@visioninfosoft.com wrote:
>method 1 (below) does work to receive a response from a server.  but
>requires I know in advance the number of bytes to receive.
>
>#method 2
>
>#cant something like this be done instead?
>#i would prefer to use this pseudo-code method
>#as there is no hard-coded number of bytes to receive
>#is there a way to achieve this?
>#          while ( $main::socket->recv($block, 8192) ) {
>#             $response .= $block;
>#          }
>#          print $response;



--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede malis"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to