develooper Front page | perl.perl5.porters | Postings from February 2013

[perl #116907] perl doesn't handle m{}g for >= 2GB files even with largefiles and 64bitall

Thread Next
From:
Jarkko Hietaniemi
Date:
February 25, 2013 09:15
Subject:
[perl #116907] perl doesn't handle m{}g for >= 2GB files even with largefiles and 64bitall
Message ID:
rt-3.6.HEAD-31961-1361661915-1125.116907-75-0@perl.org
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #116907]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=116907 >


To replicate one way is to first generate a big XML file:

perl -e 'for (0..2**27){print "<id>$_</id>\n"}' > big.xml

This generates a (rather boring) XML of 2439025741 bytes, safely north 
of 2**31 bytes.

This works, printing "--0--\n" etc.:

dd if=big.xml bs=1048576 count=2047 | perl -wlne 'BEGIN{undef $/};print
length;while(m{<id>(.+?)</id>}g){print "--$1--"}'|head

This doesn't, the only thing output from perl is the length():

dd if=big.xml bs=1048576 count=2048 | perl -wlne 'BEGIN{undef $/};print
length;while(m{<id>(.+?)</id>}g){print "--$1--"}'|head

I originally had m{}gs since I was looking for multiline things but 
managed to shave it down to this.

Verified to happen in 5.16.2 (in Ubuntu Precise Pangolin) x86_64, and in 
bleadperl in whatever is the latest OS X.  In both cases:

useperlio=define,uselargefiles=define,use64bitint=define, use64bitall=define


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