Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,
I want to create an hour glass on unix terminal using perl but without using Perl/Tk or pTk. I would like to know if I can use any other module to create hourglass? And I should be able to destroy the hourglass as per my wish. Any help would be highly appreciated. Thnx in advance.
Misba.

Replies are listed 'Best First'.
Re: Creating hourglass using PERL
by GrandFather (Saint) on Oct 26, 2005 at 09:41 UTC
Re: Creating hourglass using PERL
by marto (Cardinal) on Oct 26, 2005 at 09:24 UTC
    Hi Misba,

    Are you trying to create an asci hour glass to display while there is something being done?
    If it has to be an hourglass I dont know of any modules to do that for you, so you may have to code that yourself.

    However, you may want to look at the Term::ProgressBar module.
    "Term::ProgressBar - provide a progress meter on a standard terminal"

    Have a look at the documentation and see if this suits your needs.

    Hope this helps.

    Martin
Re: Creating hourglass using PERL
by virtualsue (Vicar) on Oct 26, 2005 at 10:37 UTC
    Given the information you've provided, the most appropriate answer is "Yes". If you give us a little more information about what you're trying to do, a more complete answer can be given.
      OKay, to be more specific, i want to create something which indicates to the user that some operation is ongoing... lets forget hourglass.. lets say i want to create progressbar .And that module must be present in @INC array.. i tried with TERM::ProgresBar but cant find it in @INC. So let me know a module which is present by default in @INC array.
Re: Creating hourglass using PERL
by Skeeve (Parson) on Oct 26, 2005 at 10:38 UTC

    In the sense of "having fun with inspecificy questions" ;-)

    perl -e '$_="44444053335053335063332036320331032360233360533350544450";tr/0-6/\nX\/ _|\\/;print'

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

      Thats awsome. ;) Just a cool use i'd never seen before. ++++++ ;)


      ___________
      Eric Hodges
Re: Creating hourglass using PERL
by ioannis (Abbot) on Oct 26, 2005 at 10:08 UTC
    You can find ProgressBar.pm inside the CursesWidgets distribution. Since it is a higher level module it requires less time to build it than first learning Curses -- hours instead of days.
Re: Creating hourglass using PERL
by Perl Mouse (Chaplain) on Oct 26, 2005 at 09:36 UTC
    I want to create an hour glass on unix terminal using perl but without using Perl/Tk or pTk.
    I never understand questions of the for "I want to do X, without using Y", where Y is an obvious way of doing X.

    Perhaps you want to use Java. That avoids using Perl, Tk and pTk.

    Yeah, I could give a different answer, using Perl and some other module. But then I bet your reply will be that you don't want to use that module either.

    Perl --((8:>*
Re: Creating hourglass using PERL
by jesuashok (Curate) on Oct 26, 2005 at 09:26 UTC
    Hi,

    you can use Curses module. Please make use of search.cpan site :-)

    "Keep pouring your ideas"
Re: Creating hourglass using PERL
by Joost (Canon) on Oct 26, 2005 at 16:14 UTC
Re: Creating hourglass using PERL
by rcseege (Pilgrim) on Oct 26, 2005 at 15:25 UTC

    Update: My guess is that you would like to change the mouse pointer to an hourglass shape to show that your program is busy while it's running, and then swap back once complete. Such a thing is fairly easy within Tk apps by calling $mw->Busy/Unbusy. As others have pointed out, there are other ways of showing that a program is busy... but if the goal is to change the cursor used by the pointer, then you are going to need either X or a library layered atop X for Unix.

    You might take a look at X11::Protocol. I think that it might be possible to do what you'd like with that, but it's not going to be easy if you haven't done much with X.

    Rob