[m-rev.] diff: Fix problems with check.pl when using remote CVS.

Paul Bone pbone at csse.unimelb.edu.au
Wed Feb 11 15:41:19 AEDT 2009


On Wed, Feb 11, 2009 at 03:18:06PM +1100, Paul Bone wrote:
> On Wed, Feb 11, 2009 at 02:36:32PM +1100, Peter Wang wrote:
> > 
> > Are you sure?
> > 
> >     wangp at taura ~ % cat hi
> >     #!/bin/sh -c "perl -w"
> >     print "hi\n";
> > 
> >     wangp at taura ~ % ./hi
> >     /bin/sh: Illegal option -
> >     zsh: exit 2     ./hi
> 
> Not anymore :-).  I've also tested this for myself, it doesn't work.
> And using env won't support passing -w to perl either.  The best case is
> to add the statment "use warn;" to the top of the perl scripts, although
> this has slightly different semantics but only the kind of semantics
> that perl programmers understand :-).
> 
> I'll change it to:
> 
>     #!/bin/sh perl
> 
>     use warn;
> 

sh still didn't work when I wrote it like this.  I've moved to
/usr/bin/env.  I've also learnt that some systems don't (correctly)
interpret more than one argument on the #! line.  For example 

    #!/usr/bin/env perl -w 

So we have to use the 'use warnings;' statment in the perl code  I've
added this to the two check scripts.  The log script never had warnings
enabled in the past so I will not enable them now.

I beleive that env will be portable enough.  I'm told that it is part of
the SUS and POSIX specifications.

Thanks.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20090211/76c8edf5/attachment.sig>


More information about the reviews mailing list