with:my $socket = new IO::Socket::INET ( peerAddr => $target, peerPort => '80', Proto => 'tcp', Timeout => $timeout,); die "Socket failed at $target\n" unless $socket; print $socket "GET http://$target/~$users[$i] HTTP/1.0\r\n\r\n +"; my @source = <$socket>;
No sense in trying to reinvent code that has been done, done again, done over, redone, and finally made fast.use LWP::Simple; my $source = get "http://$target/~$users[$i]";
Oh, and then you won't need to check return statuses... you'll either have the content, or undef. So the rest of your code also becomes simpler.
Right tool for the job.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re: Completely lost - 'Use of uninitialized value in pattern match...' error :(
by merlyn
in thread Completely lost - 'Use of uninitialized value in pattern match...' error :(
by n00dles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |