Gossamer Forum
Home : General : Perl Programming :

Beginner Perl Package Question

(Page 2 of 2)
> >
Quote Reply
Re: [Paul] Beginner Perl Package Question In reply to
Wil...

I don't get it why you think OO should be required. While objects are spiffy and cool to use, there is simply no use to having them in many situations. Do you think we should have to do $obj->blah() for every freaking function?

As for myself, I'll be doing:

Code:
use Perl5;

when Perl6 comes out (in like what, 2 years??)

just my 2 frogging cents.

--Philip
Links 2.0 moderator
Quote Reply
Re: [sponge] Beginner Perl Package Question In reply to
You mean you will still be using Perl 5 instead of 'upgrading' to Perl 6? There will be no such thing as use Perl5 - there wil be a mechanism maybe, which is yet undetermined (probably a bytecode converter) but that's far down the line.

You can download Parrott now, though, and have a play around and see if you like it or not. I'm a general believer in don't knock it until yo've tried it ...

- wil
Quote Reply
Re: [Wil] Beginner Perl Package Question In reply to
>>
There will be no such thing as use Perl5
<<

How do you know, are you a perl6 developer?

In any case I think Drew was being sarcastic Wink
Quote Reply
Re: [Paul] Beginner Perl Package Question In reply to
Not personally, but I do follow Perl 6 development closely, and if you read a transript of a recent lecture by Larry himself you willl know where I'm coming from:

http://www.perl.com/pub/at/16

- wil
Quote Reply
Re: [Wil] Beginner Perl Package Question In reply to
http://archive.develooper.com/...rl.org/msg00064.html

Tongue
Quote Reply
Re: [Paul] Beginner Perl Package Question In reply to
Yep... Note that it's just a proposal, like you and me can add proposals to the list. Just subscribe to the Perl6 porters list.

Notice the timestamp of the message -- Date: Thu, 31 Aug 2000 14:49:30 +1000 -- and notice how recently Larry's speech was at YAPC::NA (I think it was the North America conferene anyway) where he made the comment.

- wil
Quote Reply
Re: [Wil] Beginner Perl Package Question In reply to
Ok Wil Wink

Last edited by:

Paul: Jul 14, 2002, 5:36 AM
Quote Reply
Re: [Ian] Beginner Perl Package Question In reply to
Hi Ian,

One note about exporting, it's generally considered bad form to export things by default. You should always leave EXPORT empty, and don't use DEFAULT in EXPORT_TAGS. The main reason is to keep the namespace clear. If you export red(), and another module happens to do the same thing, unless the programmer is familiar with both modules, their will be quite a bit of confusion.

As for OO, I highly recommend you try out:

http://perldoc.com/....1/pod/perlboot.html

and then:

http://perldoc.com/....1/pod/perltoot.html

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Wil] Beginner Perl Package Question In reply to
I never said I wouldn't upgrade to Perl6. I'm just saying rather that I don't see OO as being the necessity that you do, and therefore I'd be inclined to stick to tradition Perl5 (use OO when/if you feel like it). I'd like to learn Perl5 completely before delving into a complete rewrite of the language.

I was quite certain I saw a definate "use Perl5" somewhere other than just the suggestion bins though, Wil.

Perl6 ain't coming out for quite a while so there's no use really speculating. I will tell you though, no backward compatiblity would be a very bad choice on Larry's part.

--Philip
Links 2.0 moderator
Quote Reply
Re: [sponge] Beginner Perl Package Question In reply to
Well, they're going to try their best, but with such a big rewrite, especially for the regex engine it's going to be difficult.

You could always just keep Perl 5 and Perl 6 both installed on your server, I guess.

- wil
Quote Reply
Re: [Alex] Beginner Perl Package Question In reply to
Hi Alex

I prefer Randal's over Tom's version, there. Especially for an OO beginner.

Cheers

- wil
Quote Reply
Re: [Alex] Beginner Perl Package Question In reply to
Hi Alex,

So by leaving EXPORT or EXPORT_OK empty, will this just export all the functions by default? Sorry, I am still a little confused.


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Aug 6, 2002, 7:48 PM
Quote Reply
Re: [Ian] Beginner Perl Package Question In reply to
No, leaving them empty will export nothing.
Quote Reply
Re: [Ian] Beginner Perl Package Question In reply to
Putting them in EXPORT will export by default (not a good idea). Putting them in EXPORT_OK will allow them to be exported. Leaving both blank will allow nothing to be exported.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Beginner Perl Package Question In reply to
Ahhhh, now I get it.

So EXPORT_OK is where I should put the list of functions, and just call up the ones from this list I wish to use. Obviously (now) I need to use one of them at least, or nothing is going to happen.

I think I have it now.

Thanks!


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Beginner Perl Package Question In reply to
Quote:
So EXPORT_OK is where I should put the list of functions, and just call up the ones from this list I wish to use. Obviously (now) I need to use one of them at least, or nothing is going to happen.

Anything in @EXPORT_OK needs to be "requested" to be imported eg....

use MyModule qw/$something &something @something/;

Anything in @EXPORT is exported by default (thats why @EXPORT_OK is recommended otherwise things can get messy).

So for example:

@EXPORT = qw/$foo/;

Then in your script:

use MyModule;

....$foo would then be accessible in your script without having to do anything.
Quote Reply
Re: [Paul] Beginner Perl Package Question In reply to
Thanks PaulSmile.


http://www.iuni.com/...tware/web/index.html
Links Plugins
> >