[Petal] Petal constructor broken?

Jean-Michel Hiver jhiver@mkdoc.com
Tue, 6 Aug 2002 10:26:19 +0100


> It looks like you changed several of the subroutines in Petal 0.5 which 
> has broken the ability to call Petal->new with the arguments such as 
> base_dir, taint, etc. Here's the code I use to call Petal:
> 
> 		$template = new Petal (
> 			base_dir => $tmpl_path,
> 			file => $template_file,
> 			disk_cache => 1,
> 			memory_cache => 1,
> 			taint => 1,
> 		);

Hi,

All these instance parameters were making the includes basically very
buggy, so I had to make them global. I forgot to update the synopsis of
the documentation, I guess it's a documentation bug...

Here is how you use it now:

# this is a new feature, multiple base directories are supported
@Petal::BASE_DIR = ('/tmp/foo', '/tmp/bar');

$Petal::DISK_CACHE = 0;
$Petal::MEMORY_CACHE = 0;
$Petal::TAINT = 1;

my $petal = new Petal ('foo.xml');

Cheers,
-- 
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
  Jean-Michel Hiver - Software Director
  jhiver@mkdoc.com
  +44 (0)114 255 8097
================================================================
                                      VISIT HTTP://WWW.MKDOC.COM