On Sun, Feb 24, 2013 at 11:17:40PM -0300, Brian Fraser wrote:
> my $over = '';
> while ( sysread( $fh, $over, 8192, length($over) ) ) {
>     while ( $over =~ /\R/ ) {
>       my $line = encode('UTF-8', substr($over, 0, $+[0], ''));

I think you meant decode. :) Decode input, encode output. The
internal storage that Perl uses isn't relevant. Apologies if I'm
wrong. I am tired. >:)

I would probably suggest moving the substr call onto a separate
line because it's already obscure that it has side effects
without explicitly assigning or referencing. I had to look it
over several times and have faith in you before I figured out how
it is meant to work.

>       do_something_with_line($line);
>     }
> }

Regards,


-- 
Brandon McCaig <bamcc...@gmail.com> <bamcc...@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bamccaig.com/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

Attachment: signature.asc
Description: Digital signature

Reply via email to