Re: The Difference Between my Globals and our Globals (WAS: Parameterizing a module)

2005-12-08 Thread vmalik
Shawn, I ran the exmaple that you provided, and it expected as I had the predicted based on the knowledge provided by Wiggins and Bob. Thanks to all of you. Vishal Quoting Shawn Corey <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: > > I see. Thanks Shawn. Since we are at it, would you mind e

Re: Parameterizing a module

2005-12-08 Thread Bob Showalter
[EMAIL PROTECTED] wrote: I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of "our" keyword. I have never understood it properly. Most books that I referred to say that it's a "lexically-scoped global variable". What does that mean? I understan

Re: Parameterizing a module

2005-12-08 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: > I see. Thanks Shawn. Since we are at it, would you mind explaining a little > bit > about the significance of "our" keyword. I have never understood it properly. > Most books that I referred to say that it's a "lexically-scoped global > variable". What does that mean? I

Re: The Difference Between my Globals and our Globals (WAS: Parameterizing a module)

2005-12-08 Thread Shawn Corey
[EMAIL PROTECTED] wrote: I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of "our" keyword. I have never understood it properly. Most books that I referred to say that it's a "lexically-scoped global variable". What does that mean? I understan

Re: Parameterizing a module

2005-12-08 Thread vmalik
I see. Thanks Shawn. Since we are at it, would you mind explaining a little bit about the significance of "our" keyword. I have never understood it properly. Most books that I referred to say that it's a "lexically-scoped global variable". What does that mean? I understand global variables to be th

Re: Parameterizing a module

2005-12-07 Thread Shawn Corey
[EMAIL PROTECTED] wrote: Thanks Shawn. But, in this case, how would we send a parameter to the module from the calling script. The module can see the name of the calling script, but I want to make my module available to other perl programmers, and let them have the flexibility of deciding which u

Re: Parameterizing a module

2005-12-07 Thread vmalik
Thanks Shawn. But, in this case, how would we send a parameter to the module from the calling script. The module can see the name of the calling script, but I want to make my module available to other perl programmers, and let them have the flexibility of deciding which use statements they want fro

Re: Parameterizing a module

2005-12-07 Thread Todd W
"Wiggins d'Anconia" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Todd W wrote: > > [snip] > > > you could do something like this: > > > > $ cat TestMod.pm > > use warnings; > > use strict; > > > > package TestMod; > > > > use Exporter; > > > > sub import { > > my $class = shift;

Re: Parameterizing a module

2005-12-07 Thread Wiggins d'Anconia
Todd W wrote: [snip] > you could do something like this: > > $ cat TestMod.pm > use warnings; > use strict; > > package TestMod; > > use Exporter; > > sub import { > my $class = shift; > foreach my $module ( @_ ) { > require $module; > } > } > > 1; > > $ cat testrun.pl > use warni

Re: Parameterizing a module

2005-12-07 Thread Todd W
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I have a module which does nothing but include a bunch of use statements (Shawn > Corey, I think you taught me how to do that).It looks like this: > > -

Re: Parameterizing a module

2005-12-07 Thread Wiggins d'Anconia
Shawn Corey wrote: > [EMAIL PROTECTED] wrote: > >> In my script, I load the module by saying "use PerlMQ;". However, now >> I want to >> load only certain use statements from the module depending on the >> parameter I >> give it. For example, in my script, I want to say "use PerlMQ >> qw(some_para

Re: Parameterizing a module

2005-12-07 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: > Hi all, > > I have a module which does nothing but include a bunch of use statements > (Shawn > Corey, I think you taught me how to do that).It looks like this: > > -- > #PerlMQ.pm > > use

Re: Parameterizing a module

2005-12-07 Thread Shawn Corey
[EMAIL PROTECTED] wrote: In my script, I load the module by saying "use PerlMQ;". However, now I want to load only certain use statements from the module depending on the parameter I give it. For example, in my script, I want to say "use PerlMQ qw(some_parameter)" in order to load the use stateme

Parameterizing a module

2005-12-07 Thread vmalik
Hi all, I have a module which does nothing but include a bunch of use statements (Shawn Corey, I think you taught me how to do that).It looks like this: -- #PerlMQ.pm use strict; use warnings; use statement1; use st