develooper Front page | perl.perl5.porters | Postings from September 2006

seek beyond length

Thread Next
From:
Juerd
Date:
September 28, 2006 05:14
Subject:
seek beyond length
Message ID:
20060928121437.GW32741@c4.convolution.nl
Is this a bug or a feature? :)

    perl -e'open my $fh, ">", \my $foo; print {$fh} 42; seek $fh, 5000, 0;
    print {$fh} 42; print $foo;'

Also, Perl should probably check the readonly flag here, and scream a
bit:

    perl -le'open my $fh, ">", \undef; print {$fh} 42; print undef;
    print defined undef'

Why are large parts of source code in memory, by the way? Is this free
memory that will be overwritten, or wasted? Would it be useful to skip
\N+ in POD and comments, to save some memory?
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <juerd@juerd.nl>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <sales@convolution.nl>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About