Term::Prompt broken? Or am I misreading documentation?

Discussion in 'Perl Misc' started by Daniel M. Drucker, Feb 10, 2004.

  1. Term::prompt appears to be either very badly broken ... or I'm
    completely misreading the documentation.

    Term::prompt's menuing system really doesn't seem to behave anything
    like described in the documentation.

    In this script, only the first prompt displays a menu at all, and
    misnumbered, at that.

    Can ANYONE tell me if I'm doing something wrong, or if this is a bug
    in Term::prompt?

    Daniel Drucker


    #!/usr/bin/perl

    use Term::prompt;

    my @fruits = qw(apple orange pear tomato grapefruit apricot peach);

    my $fruitnum = &prompt("m", {
    prompt => "Choose:",
    title => "Fruits",
    items => [@fruits],
    order => 'down',
    accept_empty_selection => 0,
    accept_multiple_selections => 0,
    });

    print "you chose " . $fruits[$fruitnum] . "\n";

    print "\n=============\n";


    my $fruitnum = &prompt("m", {
    prompt => "Choose:",
    title => "Fruits",
    items => [@fruits],
    order => 'down',
    cols => 1,
    accept_empty_selection => 0,
    accept_multiple_selections => 0,
    });

    print "you chose " . $fruits[$fruitnum] . "\n";

    print "\n=============\n";

    my $fruitnum = &prompt("m", {
    prompt => "Choose:",
    title => "Fruits",
    items => [@fruits],
    order => 'across',
    accept_empty_selection => 0,
    accept_multiple_selections => 0,
    });

    print "you chose " . $fruits[$fruitnum] . "\n";

    print "\n=============\n";

    my $fruitnum = &prompt("m", {
    prompt => "Choose:",
    title => "Fruits",
    items => [@fruits],
    order => 'across',
    rows => 1,
    accept_empty_selection => 0,
    accept_multiple_selections => 0,
    });

    print "you chose " . $fruits[$fruitnum] . "\n";

    print "\n=============\n";
    Daniel M. Drucker, Feb 10, 2004
    #1
    1. Advertising

  2. Daniel M. Drucker

    Bill Guest

    Daniel M. Drucker wrote:

    > Term::prompt appears to be either very badly broken ... or I'm
    > completely misreading the documentation.
    >
    > Term::prompt's menuing system really doesn't seem to behave anything
    > like described in the documentation.
    >
    > In this script, only the first prompt displays a menu at all, and
    > misnumbered, at that.
    >
    > Can ANYONE tell me if I'm doing something wrong, or if this is a bug
    > in Term::prompt?
    >
    > Daniel Drucker
    >
    >
    > #!/usr/bin/perl
    >
    > use Term::prompt;
    >
    > my @fruits = qw(apple orange pear tomato grapefruit apricot peach);
    >
    > my $fruitnum = &prompt("m", {
    > prompt => "Choose:",
    > title => "Fruits",
    > items => [@fruits],
    > order => 'down',
    > accept_empty_selection => 0,
    > accept_multiple_selections => 0,
    > });
    >


    I'm pretty sure that the above is not a correct call of the 'prompt'
    function. Though why it behaves the way it does is unclear. What happens
    if you add 'use strict'?
    Bill, Feb 12, 2004
    #2
    1. Advertising

  3. Bill <> wrote in message news:<>...
    > I'm pretty sure that the above is not a correct call of the 'prompt'
    > function. Though why it behaves the way it does is unclear. What happens
    > if you add 'use strict'?


    Not sure, as I got Term::prompt version 0.12 (in the process of being
    posted to CPAN - there's been a change of package ownership that's
    delayed it), which fixed the problem.

    Daniel Drucker
    Daniel M. Drucker, Feb 14, 2004
    #3
  4. > Not sure, as I got Term::prompt version 0.12 (in the process of being
    > posted to CPAN - there's been a change of package ownership that's


    Term::prompt 0.12 is now available on CPAN, and solves the problem I was having.

    Daniel
    Daniel M. Drucker, Feb 16, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Endless Story
    Replies:
    9
    Views:
    597
    Endless Story
    Feb 16, 2007
  2. Steven D'Aprano

    Why are "broken iterators" broken?

    Steven D'Aprano, Sep 21, 2008, in forum: Python
    Replies:
    8
    Views:
    645
  3. gaurav kashyap
    Replies:
    2
    Views:
    613
    gaurav kashyap
    Oct 30, 2008
  4. gaurav kashyap
    Replies:
    3
    Views:
    683
    gaurav kashyap
    Oct 31, 2008
  5. Mel
    Replies:
    10
    Views:
    3,113
    Sailaja Appi
    Feb 13, 2009
Loading...

Share This Page