RE: [code-review] Tie::Array::Bounded
"Hodges, Paul" <Paul.Hodges-ntWzkUHD06N8olp/[email protected]> Fri, 21 Nov 2003 14:32:09 -0600
| Newsgroups | gmane.comp.lang.perl.code-review-ladder |
|---|---|
| Message-ID | <9C375DDD9B669243A2D78FCD607E894003E4FD15@bremo-jg> |
> I'm just curious if anyone else has used a similar trick I've used in
> the past. My INSTALL file is executable, and thus:
>
> #!/bin/sh
> perl Build.PL
> ./Build
> ./Build test
> ./Build install
>
> So as to allow the user a single step:
>
> ./INSTALL
Try:
#!/bin/sh
perl Build.PL
err=''
./Build && ./Build test || err="failed"
echo "$err" | grep -q "failed" || ./Build install
Actually, I recommend a more readable and elaborated scenario, but this
should be *sort* of portable, and wouldn't take but a few minutes.
Even better, use Perl.
#!/usr/local/bin/perl
do 'Build.pl';
system "./Build" ? die "./Build failed -- $!\n" : system "./Build
test"
? die "./Build test failed -- $!\n" : system "./Build
install"
? die "./Build install failed -- $!\n" : print "Install
done.\n";
You might need to tweak that a bit, but it's still much more powerful,
flexible, and precise....
*****
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material. Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers.61"