Since you have no numbers next to the lines, we have to guess. I suspect
$user = $file;
to be the culprit, since you just clobber the $user variable whose value you just read from STDIN and carefully chomped, with an undefined value: the my $file above is defined only for the foreach context. use strict would catch that. And so,
chdir("$hdir/$user") || die "Cant Change to directory $hdir/$user: $!\ +n";
causes the the warning to be thrown. Where's $hdir defined?
Anyways, that should be
my $number = <STDIN>; chomp $number; die "Invalid selection\n" if $number =~ /\D/; die "Number given too big\n" if $number > scalar(@ulist); my $user = $ulist[$number]; chdir("$hdir/$user") || die "Cant Change to directory $hdir/$user: $!\ +n";
In reply to Re: Creating a Menu List
by shmem
in thread Creating a Menu List
by muizelaar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |