$MAIL_ROOT = '/var/mail'; my @users = (map s/$MAIL_ROOT// , `find $MAIL_ROOT -type d -maxdepth 1`); #### my @users = `find $MAIL_ROOT -type d -maxdepth 1`; foreach (@users) { chomp; s/$MAIL_ROOT//; print $_ . "\n" unless $_ eq ''; } #### chomp( my @users = map { s/$MAIL_ROOT//; $_ } `find $MAIL_ROOT -type d + -maxdepth 1` );