fauxpas has asked for the wisdom of the Perl Monks concerning the following question:
What's a quick way to read in a line (as defined by $/) with a specified maximum length? I want to read in lines of input from unauthenticated connections over the network and I'm worried that by using <FILEHANDLE> I allow someone to blow out the memory on my server. Something that's as easy to use as
while ( $line=read_a_line(FILEHANDLE,$maxlinelen) ) {}
would be nice. =)
while ( $line=read_a_line(FILEHANDLE,$maxlinelen) ) {}
would be nice. =)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Read a line with max length ?
by graff (Chancellor) on Feb 27, 2003 at 04:02 UTC | |
by isotope (Deacon) on Feb 27, 2003 at 05:27 UTC | |
by Elian (Parson) on Feb 27, 2003 at 23:15 UTC | |
by fauxpas (Initiate) on Feb 27, 2003 at 04:15 UTC | |
Re: Read a line with max length ?
by FoxtrotUniform (Prior) on Feb 27, 2003 at 03:24 UTC | |
Re: Read a line with max length ?
by robmueller (Novice) on Jun 18, 2009 at 08:22 UTC | |
Re: Read a line with max length ?
by cees (Curate) on Feb 27, 2003 at 03:22 UTC | |
by FoxtrotUniform (Prior) on Feb 27, 2003 at 03:27 UTC | |
Re: Read a line with max length ?
by Zaxo (Archbishop) on Feb 27, 2003 at 11:43 UTC | |
by graff (Chancellor) on Feb 27, 2003 at 22:44 UTC |
Back to
Seekers of Perl Wisdom