in reply to Re: World Builder: the recovery and archeology of old programs.
in thread World Builder: the recovery and archeology of old programs.

kyle, I think that looping through the array you should not take the first match, but also verify that it is the only match. This to enforce the "minimal unique" requirement: if there are two options beginning with "kn" then "kn" is not a valid input but perhaps "kno" is.

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

  • Comment on Re^2: World Builder: the recovery and archeology of old programs.

Replies are listed 'Best First'.
Re^3: World Builder: the recovery and archeology of old programs.
by kyle (Abbot) on Sep 17, 2008 at 16:35 UTC

    If you want to be sure you have only one match, do it this way...

    my @picks = grep { ... } @menu; if ( 1 < scalar @picks ) { die "Too many options match your input, '$input'\n"; } $picked = $picks[0];