use Path::Class qw( dir file ); my $root = dir( '/' ); my $spool = $root->subdir( 'var', 'spool' ); my $line = ($spool->slurp)[0]; my @names = $spool->children;