in reply to IO::Socket Get Headers
my @request_headers = <$c>;
reads until the end of the file, pushing each line onto the array. However, you're suppose to stop reading when you see CRLFCRLF. To read just the next line, do:
my $next_line = <$c>;
You're reinventing the wheel, though. (And you're already doing things wrong, like reading too far, and not setting $/ to "\015\012".) There's already at least one mini perl httpd you can use, HTTP::Daemon, and I think it even comes standard with perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IO::Socket Get Headers
by JoeJaz (Monk) on Oct 02, 2004 at 05:02 UTC | |
|
Re^2: IO::Socket Get Headers
by JoeJaz (Monk) on Oct 04, 2004 at 08:55 UTC | |
by ikegami (Patriarch) on Oct 04, 2004 at 14:31 UTC | |
by JoeJaz (Monk) on Oct 04, 2004 at 22:26 UTC | |
by ikegami (Patriarch) on Oct 04, 2004 at 22:34 UTC | |
by JoeJaz (Monk) on Oct 05, 2004 at 01:02 UTC |