in reply to Re: Re: Drop Down Selection #2
in thread Drop Down Selection #2

# open the text database unless(open(PFD,$db)) { &printError("Could not open user database"); exit(1); } my @users; # first check if user exist $path=''; while (<PFD>) { chomp; ($u,$p,$path)=split('\|',$_);###$u loop?? how? push @users, $u; if ($userid eq $u) { $rc=1; last; } } close(PFD); print $query->popup_menu(-name=>'userid', -values=>\@users);
That should work, but in your code you do a last if $userid eq $u, which means @users will store all the users in the list until the one that matches $userid... not sure if that is what you want.
                - Ant

Replies are listed 'Best First'.
Re (tilly) 4: Drop Down Selection #2
by tilly (Archbishop) on May 09, 2001 at 11:39 UTC
    The presence of an error check is less valuable than the presence of an error check that captures all relevant status information.

    As perlstyle says, including the name of the file you are trying to open and the contents of $! is a substantive style issue. That information is valuable, and when things go wrong you want to have it from the start.

Re: Re: Re: Re: Drop Down Selection #2
by koacamper (Acolyte) on May 09, 2001 at 06:35 UTC
    Thank you very much! That did the trick! I have been working on this for far too long! I sincerely appreciate your assistance.