sub read { my ($cpio, $file) = @_; my $IN; if (ref $file) { $IN = $file; } else { open($IN, '<', $file) or die "can't open $file: $!\n"; } read_with_handler($cpio, $IN, sub { my ($e) = @_; push @{$cpio->{list}}, $e; });