Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > newbie cspan example question

Reply
Thread Tools

newbie cspan example question

 
 
ToddAndMargo@gbis.com
Guest
Posts: n/a
 
      10-06-2006
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

 
Reply With Quote
 
 
 
 
Mirco Wahab
Guest
Posts: n/a
 
      10-06-2006
Thus spoke http://www.velocityreviews.com/forums/(E-Mail Removed) (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
 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      10-06-2006
(E-Mail Removed) 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.
 
Reply With Quote
 
ToddAndMargo@gbis.com
Guest
Posts: n/a
 
      10-07-2006

Mirco Wahab wrote:
> Thus spoke (E-Mail Removed) (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.

 
Reply With Quote
 
ToddAndMargo@gbis.com
Guest
Posts: n/a
 
      10-07-2006

> 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.

 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      10-07-2006

Quoth (E-Mail Removed):
>
> Mirco Wahab wrote:
> > Thus spoke (E-Mail Removed) (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)
* (E-Mail Removed) *
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      10-07-2006
(E-Mail Removed) <(E-Mail Removed)> 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
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      10-07-2006
(E-Mail Removed) <(E-Mail Removed)> wrote:
> Tad McClellan <(E-Mail Removed)> 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
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.Net newbie question (example code appreciated) 2b|!2b==? ASP .Net 1 04-02-2007 01:02 PM
'example.com' == 'example.com.' => false... is this intended? Sam Roberts Ruby 15 02-07-2005 04:36 PM
Warning message when compiling example program - newbie question Soundar Java 1 01-27-2005 03:43 PM
newbie question on Python tutorial example in section 4.7.1 (default arg values) Porky Pig Jr Python 5 05-03-2004 10:15 PM
newbie question - simple java socket example - it works but how do i . . . stan k. Java 3 09-27-2003 01:15 PM



Advertisments