--- src/Portage.pm_unitialzed 2012-09-20 19:24:48.446158028 +0200 +++ src/Portage.pm_unitialzed 2012-09-20 19:31:06.462844468 +0200 @@ -256,13 +256,17 @@ my $DQVAL = qr{"((?:[^\\"]|\\.)*)"}s; # doublequoted value my ($fname) = @_; + + # If the file is empty, return quietly + return unless (-s $fname); + my %env; if(open my $file, '<', $fname) { { local $/; $_ = <$file> } eval { for(;;) { /\G$BLANK/gc; - last if pos == length; + last if (pos || -1) == length; /\G$IDENT/gc or die; my $name = $1; /\G$BLANK/gc;