newbie cspan example question

Discussion in 'Perl Misc' started by ToddAndMargo@gbis.com, Oct 6, 2006.

  1. Guest

    Hi All,

    A am real new to Perl. My background is Modula2 and Bash scripts.
    I love all the examples at CSPAN.

    I have been looking at:
    http://search.cpan.org/~ugansert/Paw-0.54/Paw/Popup.pm

    @butt=('Okay', 'Cancel');
    $text=('Do you really want to continue ?');
    $pu=Popup::new(height=>20, width=>20,
    buttons=>\@butt, text=>\$text);

    Having run the example and being told that something important
    was missing (Popup::new) I though I had better ask the following
    questions:

    1) On the page, it lists the "source" for popup::new. Is this a
    standard function library that
    I have to import into my code (like a library or external module in
    Modula2)?
    If so, what is the syntax?

    2) Do I instead, copy and paste the source code into the top (or
    bottom) of my test program
    and simple use it as a subroutine?

    3) Are these examples all coded into a standard library that I simple
    call out
    in my code? If so, where do I download them? And, what is the syntax
    to import them into my test program?

    Many thanks,
    --T
    , Oct 6, 2006
    #1
    1. Advertising

  2. Mirco Wahab Guest

    Thus spoke (on 2006-10-06 02:02):
    > I have been looking at:
    > http://search.cpan.org/~ugansert/Paw-0.54/Paw/Popup.pm
    >
    > @butt=('Okay', 'Cancel');
    > $text=('Do you really want to continue ?');
    > $pu=Popup::new(height=>20, width=>20,
    > buttons=>\@butt, text=>\$text);
    >
    > Having run the example and being told that something important
    > was missing (Popup::new) I though I had better ask the following
    > questions:


    'paw' seems to be an old SuSE-related package
    for drawing text shapes and stuff on top of
    the unix 'curses' library. You need to have
    that installed.

    The 'paw'-documentation doesn't seem to help
    much, its not longer maintained and I guess
    nobody uses it much (could be wrong here).

    The 'modules' you need, which are mostly
    given in the 'paw'-examples, must be
    installed before to your Perl-system
    by the 'cpan' script.

    $> cpan

    will first brag about itself, ask
    you some things and will allow you,
    finally, to install things:

    #[CPAN]> install Paw

    the CPAN-programm will then try to load the
    module from one of the internet archives
    and install it on your computer. Do this
    with all the modules you need.

    Then you can use the Paw module and its
    descendents by including it on top of
    your script file:

    -----[myfile.pl]----------

    use Curses;
    use Paw;
    use Paw::Button;
    use Paw::Box;
    use Paw::Window;
    ...

    # enter your Paw-related code here


    The 'use' statements will load the
    Paw-Modules (if you installed them before)
    and the Rest of your program will know now
    what to do if it stumbles upon:

    ...
    @butt=('Okay', 'Cancel');
    $text=('Do you really want to continue ?');
    $pu=Popup::new(height=>20, width=>20,
    buttons=>\@butt, text=>\$text);
    ...


    In the end, it turns out the Perl-Module
    System (CPAN) is one of the best
    "Software-Block" providing systems
    in existence.

    Regards

    Mirco
    Mirco Wahab, Oct 6, 2006
    #2
    1. Advertising

  3. J. Gleixner Guest

    wrote:
    > Hi All,
    >
    > A am real new to Perl. My background is Modula2 and Bash scripts.
    > I love all the examples at CSPAN.


    Too much drama, on CSPAN. :)

    There's no need to put 'newbie' in every subject, just set the
    subject to something that briefly states your question.

    >
    > I have been looking at:
    > http://search.cpan.org/~ugansert/Paw-0.54/Paw/Popup.pm
    >
    > @butt=('Okay', 'Cancel');
    > $text=('Do you really want to continue ?');
    > $pu=Popup::new(height=>20, width=>20,
    > buttons=>\@butt, text=>\$text);
    >
    > Having run the example and being told that something important
    > was missing (Popup::new) I though I had better ask the following
    > questions:


    Possibly going through a few tutorials will get you up to speed
    faster than posting a question every time something doesn't work.

    http://www.perlmonks.org/index.pl?node=Tutorials

    There are also plenty of books ( perldoc perlbook ), tutorials, and
    online documentation, along with the documentation that came along
    with your installed version of perl.
    J. Gleixner, Oct 6, 2006
    #3
  4. Guest

    Mirco Wahab wrote:
    > Thus spoke (on 2006-10-06 02:02):
    > > I have been looking at:
    > > http://search.cpan.org/~ugansert/Paw-0.54/Paw/Popup.pm
    > >
    > > @butt=('Okay', 'Cancel');
    > > $text=('Do you really want to continue ?');
    > > $pu=Popup::new(height=>20, width=>20,
    > > buttons=>\@butt, text=>\$text);
    > >
    > > Having run the example and being told that something important
    > > was missing (Popup::new) I though I had better ask the following
    > > questions:

    >
    > 'paw' seems to be an old SuSE-related package
    > for drawing text shapes and stuff on top of
    > the unix 'curses' library. You need to have
    > that installed.
    >
    > The 'paw'-documentation doesn't seem to help
    > much, its not longer maintained and I guess
    > nobody uses it much (could be wrong here).
    >
    > The 'modules' you need, which are mostly
    > given in the 'paw'-examples, must be
    > installed before to your Perl-system
    > by the 'cpan' script.
    >
    > $> cpan
    >
    > will first brag about itself, ask
    > you some things and will allow you,
    > finally, to install things:
    >
    > #[CPAN]> install Paw
    >
    > the CPAN-programm will then try to load the
    > module from one of the internet archives
    > and install it on your computer. Do this
    > with all the modules you need.
    >
    > Then you can use the Paw module and its
    > descendents by including it on top of
    > your script file:
    >
    > -----[myfile.pl]----------
    >
    > use Curses;
    > use Paw;
    > use Paw::Button;
    > use Paw::Box;
    > use Paw::Window;
    > ...
    >
    > # enter your Paw-related code here
    >
    >
    > The 'use' statements will load the
    > Paw-Modules (if you installed them before)
    > and the Rest of your program will know now
    > what to do if it stumbles upon:
    >
    > ...
    > @butt=('Okay', 'Cancel');
    > $text=('Do you really want to continue ?');
    > $pu=Popup::new(height=>20, width=>20,
    > buttons=>\@butt, text=>\$text);
    > ...
    >
    >
    > In the end, it turns out the Perl-Module
    > System (CPAN) is one of the best
    > "Software-Block" providing systems
    > in existence.
    >
    > Regards
    >
    > Mirco


    Thank you!

    The cpan script sounds a lot like YUM. And, the "use" statement is on
    the same
    lines as Modula2's use of external modules. :)
    , Oct 7, 2006
    #4
  5. Guest


    > Possibly going through a few tutorials will get you up to speed
    > faster than posting a question every time something doesn't work.


    too dumb a moment to know where to look. Have stinkin' deadline
    too. :')

    >
    > http://www.perlmonks.org/index.pl?node=Tutorials


    Great link! Thank you.
    , Oct 7, 2006
    #5
  6. Ben Morrow Guest

    Quoth :
    >
    > Mirco Wahab wrote:
    > > Thus spoke (on 2006-10-06 02:02):
    > > >
    > > > Having run the example and being told that something important
    > > > was missing (Popup::new) I though I had better ask the following
    > > > questions:

    > >
    > > 'paw' seems to be an old SuSE-related package
    > > for drawing text shapes and stuff on top of
    > > the unix 'curses' library. You need to have
    > > that installed.
    > >
    > > [use CPAN.pm to install it]

    >
    > The cpan script sounds a lot like YUM.


    If you use an OS with a package manager (which I presume is what YUM is)
    then it is probably worth looking to see if you can install Perl modules
    as packages, rather than using CPAN.pm. If the module you want isn't
    provided by your OS as a package, then at least make sure CPAN.pm
    installs its packages somewhere different from your OS's package
    manager: having two package management systems fighting over one set of
    files is a recipe for Pain. Recent(ish) versions of Perl, if configured
    as recommended, have three separate module trees (per installed version
    of Perl): one for 'core modules', which come with Perl; one for 'vendor
    modules', which are installed by the OS package manager; and one for
    'site modules', installed with CPAN.pm or manually by the sysadmin.

    > And, the "use" statement is on
    > the same
    > lines as Modula2's use of external modules. :)


    Yes. Pretty much every modern language provides this facility.

    Ben

    --
    And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
    * *
    Ben Morrow, Oct 7, 2006
    #6
  7. <> wrote:

    > Subject: Re: newbie cspan example question

    ^^^^^^

    [ snip about 80 lines of full-quote ]


    > Thank you!



    Please see the Posting Guidelines that are posted here frequently.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Oct 7, 2006
    #7
  8. <> wrote:
    > Tad McClellan <> writes:
    >> > Subject: Re: newbie cspan example question

    >> ^^^^^^

    >
    > I think you've hit the nail on the head :) If we all just killfile any
    > post with "newbie"



    Many folks _do_ do that.

    That is preciously why not including it in the Subject is included
    in the guidelines.

    The starting point for writing the guidelines was reviewing the
    killfiles of several regular posters with an aim of providing
    guidelines to help avoid such a fate.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Oct 7, 2006
    #8
    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. stan k.
    Replies:
    3
    Views:
    6,637
    Gordon Beaton
    Sep 27, 2003
  2. Soundar
    Replies:
    1
    Views:
    419
    JavaJava
    Jan 27, 2005
  3. Porky Pig Jr
    Replies:
    5
    Views:
    415
    Porky Pig Jr
    May 3, 2004
  4. 2b|!2b==?
    Replies:
    1
    Views:
    653
    Alexey Smirnov
    Apr 2, 2007
  5. Sam Roberts
    Replies:
    15
    Views:
    278
    Sam Roberts
    Feb 7, 2005
Loading...

Share This Page