[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #!/usr/bin/env perl
From: |
Andreas Enge |
Subject: |
Re: #!/usr/bin/env perl |
Date: |
Sat, 23 Feb 2013 01:03:21 +0100 |
User-agent: |
KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) |
Am Samstag, 23. Februar 2013 schrieb Ludovic Courtès:
> > (make-regexp
> > "^[[:blank:]]*([[:graph:]]+)[[:blank:]]*([[:graph:]]*)(.*)$")))
>
> I think it should be a + after the second [[:blank:]], because there
> should be space between the interpreter name and its argument.
Sometimes, there is no space at all: In
#!/usr/bin/perl
for instance, when there is no argument. Then the "+" version would fail.
With "*", it works as expected.
> What about more descriptive names like ‘interp’, ‘arg1’, and ‘rest’?
Maybe. I did not choose descriptive names because the real interpreter is
sometimes the first, sometimes the second piece. But your suggestion looks
good.
> Rather (has-env? (string-suffix? "/env" interp)).
Ok, thanks.
> > + (if has-env
> > + (begin
> Please align with the ‘h’ here...
> > + (patch p bin
> > + (string-append " " second
> > third)))))
> ... and with the ‘p’ here.
Ok. The annoying thing with this way of indenting is that lines become very
long very quickly; I like keeping them at less than 80 characters.
Andreas
- Re: #!/usr/bin/env perl, Andreas Enge, 2013/02/22
- Re: #!/usr/bin/env perl, Ludovic Courtès, 2013/02/22
- Re: #!/usr/bin/env perl,
Andreas Enge <=
- Re: #!/usr/bin/env perl, Andreas Enge, 2013/02/23
- Re: #!/usr/bin/env perl, Ludovic Courtès, 2013/02/23
- Re: #!/usr/bin/env perl, Andreas Enge, 2013/02/23
- Re: #!/usr/bin/env perl, Ludovic Courtès, 2013/02/23
- Re: #!/usr/bin/env perl, Andreas Enge, 2013/02/23
- Re: #!/usr/bin/env perl, Ludovic Courtès, 2013/02/23
- Re: #!/usr/bin/env perl, Andreas Enge, 2013/02/23
Re: #!/usr/bin/env perl, Mark H Weaver, 2013/02/24