Ask a Question related to PERL Beginners, Design and Development.
-
Dan Muey #1
RE: Quick export question
> I'm wanting to setup a module that will export whatever is in
Sorry about the mess there, Let me fix it:> @EXPORT (if anythign) and ':basic'
>
> IE I want
> use Monkey;
> To be identical to
> use Monkey qw(:basic);
>
> So if I have this on the module which of 3 ways I'm trying to
> accoomplish that are valid (if any)?
>
> %EXPORT_TAGS = {
> ':basic' => [qw(fred wilma barney dino)],
> };
$EXPORT_TAGS{':DEFAULT'} = $EXPORT_TAGS{':basic'};
Or
$EXPORT_TAGS{':DEFAULT'} .= $EXPORT_TAGS{':basic'};
Or
$EXPORT_TAGS{':DEFAULT'} = > ($EXPORT_TAGS{':basic'},@EXPORT);
There that's more readable!
>
> TIA
>
> Dan
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>Dan Muey Guest
-
very quick question
In my database a field is designated as 0 or -1 . When i make my form how do i set up the drop down menu so that the user chooses yes or no and... -
Quick CSS question
Hi, I have a css file that I used when building my template. Now that I'm building additional pages from the template, do I edit the same css file... -
quick MX question....
how do you get rid of that window on the right where it says 'color swatches', 'components', etc.. it really bothers me, it makes the working area... -
Quick question
if you want to select top 100 records, you will use SELECT TOP 100 * FROM tableName Is there anyone knows how to find bottom 100 records? ... -
A Quick Question
Does anyone know if it is possible to create a Flash movie that has the ability to let the user click on a button to begin the installation of a... -
Charles K. Clarkson #2
RE: Quick export question
Dan Muey <dmuey@infiniplex.com> wrote:
:
: I'm wanting to setup a module that will export whatever is in
: @EXPORT (if anythign) and ':basic'
:
: IE I want
: use Monkey;
: To be identical to
: use Monkey qw(:basic);
Seems like you really need is a way to test this
for yourself. Here's a quickie I just wrote. I'm sure
it fails for some modules, but . . .
use strict;
use warnings;
use Data::Dumper;
print Dumper imported( 'CGI', ':html' );
sub imported {
my( $module, @import ) = @_;
require "$module.pm";
my @previous_keys = keys %::;
import $module @import;
my %symbol_table = %::;
delete @symbol_table{ @previous_keys };
return [ keys %symbol_table ];
}
HTH,
Charles K. Clarkson
--
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328
Charles K. Clarkson Guest
-
Bob Showalter #3
RE: Quick export question
Dan Muey wrote:
Probably this will work (haven't tried it):> I'm wanting to setup a module that will export whatever is in
> @EXPORT (if anythign) and ':basic'
>
> IE I want
> use Monkey;
> To be identical to
> use Monkey qw(:basic);
>
> So if I have this on the module which of 3 ways I'm trying to
> accoomplish that are valid (if any)?
>
> %EXPORT_TAGS = {
> ':basic' => [qw(fred wilma barney dino)],
> };
> $EXPORT_TAGS{':DEFAULT'} = $EXPORT_TAGS{':basic'}; # this would do it
> right? Or
> $EXPORT_TAGS{':DEFAULT'} .= $EXPORT_TAGS{':basic'}; Or
> $EXPORT_TAGS{':DEFAULT'} = ($EXPORT_TAGS{':basic'},@EXPORT);
$EXPORT_TAGS{':DEFAULT'} = [ @{$EXPORT_TAGS{':basic'}}, @EXPORT ];
But I would do this instead:
my @basic = qw(fred wilma barney dino);
our @EXPORT = (qw/foo bar baz/, @basic);
our %EXPORT_TAGS = (':basic' => \@basic);
I don't think defining :DEFAULT for yourself is what the author of Exporter
had in mind...
Bob Showalter Guest



Reply With Quote

