perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0/t/conf extra.last.conf.in perlsection.conf
Date Tue, 10 Feb 2004 01:58:33 GMT
Philippe M. Chiasson wrote:

>>>What's the advantage of using A::TC::writefile instead ?
>>
>>It doesn't cleanup the files and doesn't log what it does. I see no reason why 
>>would you want to delete it. t_write_file is for the test run-time.
> 
> 
> I can't really call Apache::TestConfig->new from within the <Perl>
> section, so how about I do it all myself on my own like so :

right, that would be an overkill too.

> Index: t/conf/extra.last.conf.in
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/t/conf/extra.last.conf.in,v
> retrieving revision 1.12
> diff -u -I$Id -r1.12 extra.last.conf.in
> --- t/conf/extra.last.conf.in   10 Feb 2004 00:14:11 -0000      1.12
> +++ t/conf/extra.last.conf.in   10 Feb 2004 01:39:28 -0000
> @@ -32,11 +32,12 @@
>  #Handle re-entrant <Perl> sections
>  <Perl >
>      use File::Spec;
> -    use Apache::TestUtil;
>      my $file = File::Spec->catfile('@ServerRoot@', 'conf', 'perlsection.conf');
> -    my $conf = join "\n", qw(<Perl> $TestDirective::perl::Included++; </Perl>);
> -    Apache::TestUtil::t_write_file($file, $conf);
> +    open(my $fh, ">$file");

or die ...

> +    print $fh join "\n", qw(<Perl> $TestDirective::perl::Included++; </Perl>);
> +    close($fh);

please use braces consistenly (i.e. don't use them ;)

>      $Include = $file;
> +    END { unlink($file); };

On the opposite, I think it should not be deleted. If something goes wrong and 
the file is deleted, after using its name in the error report how user is 
supposed to know where to look?

It's really like conf.in, but you can't use that feature, because you want to 
include it elsewhere.

Another solution is just move it somewhere under t/htdocs/ and keep the 
perlsection.conf cvs committed as you did in first place. No need to 
autogenerate things then.

>  </Perl>


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message