in reply to Formatting The Communist Manifesto

while($char = getc(SOURCE)){
Make this
while(defined($char = getc(SOURCE))){
As suggested, if $char encounters a "0", it'll stop.