The shell version is straightforward enough
type indent >/dev/null 2>&1 && indent || cat
Were you looking for a perl version?
Chris
--
Chris Davies, Manheim Online
Tel. 0113 393-2004 Fax. 0870 444-0482. Mobile 07778 199069
-----Original Message-----
From: Sam Tregar [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 16, 2001 6:40 PM
To: Dan Kubb
Cc: [EMAIL PROTECTED]
Subject: Re: [htmltmpl] Problem with HTML::Template::JIT
On Wed, 12 Dec 2001, Dan Kubb wrote:
> I think I found two bugs and/or problems in HTML::Template::JIT:
>
> - in HTML::Template::JIT::Compiler, if you use the "jit_debug"
> switch in the new constructor, it will open a pipe to the
> indent shell command. My linux machine doesn't have this
> binary installed and complains when it can't find it. Should
> this module rely on a shell command, or should it implement
> it in pure perl? I figured it's a relic from debugging that
> you forgot to remove =)
Ah, yes, I meant to document that. There's no way I'm going to implement
indent in pure Perl but I'd be happy to accept a patch that checks to see
if indent is available before trying to call it. Problem is, I can't
think of any easy ways to do that...
> - I found the above bug when trying to figure out why my
> program wouldn't function. It doesn't seem to want to
> do the initial compile of the template when Taint it
> turned on.
Hmmm, I never tested it under taint mode... I'll see about adding a few
tests for the next release.
> use File::Spec::Functions qw(catfile tmpdir curdir);
How does File::Spec compute tmpdir? If it looks at %ENV then the return
value could be tainted.
Thanks!
-sam
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]