in reply to Glob + list = list concatenation

If you don't want to destroy @values as you go along (as some of the above solutions do), you can make an iterator to return the appropriate "next thing":
my $iter = do { my $i; sub { $i < @values ? $values[$i++] : <$filehandle> } }; while ( my $line = $iter->() ) { ## do stuff ... }
The readline on the filehandle is still not performed until needed and @values is kept intact.

blokhead