You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jamie LeTual <ja...@hbesoftware.com> on 2001/06/06 05:52:36 UTC

Re: ´ð¸´: In module require configuration file [frig]

typos, sorry. Damned cut and paste

Jamie LeTual wrote:
 > 
 > How about this:
 > 
 > #======= mymodule.pm =========
 > package mymodule;
 > use strict;
 > 
 > sub new
 > {
 >         my $type = shift;
 >         my $conf  = shift;
 > 
 >         my $self = { conf => require $conf };
 >         bless $self, $type;
 > 
 >         return $self;
 > }
 > 
 > 1;
 > #======= conf.pl =========
 > { web_name => 'foo.com' };
 > 
-> #======= conf.pm =========
+> #======= somefile.pl =========
 > #!/usr/bin/perl
 > use strict;
 > use Data::Dumper;
 > use mymodule;
 > 
-> my $m = mymodule->new('conf.pm');
+> my $m = mymodule->new('conf.pl');
 > print Dumper($m);
 > 

...

-- 
-[sent from home]-----------------------------------------------
| Jamie LeTual             |Email : jamie@mail.letual.net       |
| Programmeur Errant       |Phone : (514) 523-0940              |
|                          |PGP   : http://people.hbe.ca/~jamie |
|__________________________|____________________________________|