On Fri, Apr 29, 2011 at 12:14:06PM -0400, [email protected] wrote:
> [email protected] writes:
>
> > CVSROOT: /home/cvs/fvwm
> > Module name: fvwm
> > Changes by: tadam 11/04/29 07:05:50
> >
> > Modified files:
> > bin : Tag: branch-2_6 ChangeLog fvwm-menu-desktop.in
> >
> > Log message:
> > Remove hard-coded #! line from fvwm-menu-desktop
> >
> > @PERL@ always interpolates out to the correct interpreter.
>
> Yeah, I know.
>
> I stuck that in there for testing purposes.
>
> (Yep I sometimes test before commit. :) )
Nah -- that's overrated. :)
> I simply forgot to remove it.
>
> If you notice I stick my test line at the bottom of the file
> for Emacs:
>
> # Local Variables:
> # mode: cperl
> # compile-command: "perl fvwm-menu-desktop.in --enable-mini-icons
> --fvwm-icons"
> # End:
>
> So, at first I thought if I fed the file to the perl interpreter nothing
> would get in the way and I could test the file directly. But I get:
>
> perl fvwm-menu-desktop.in --enable-mini-icons --fvwm-icons
> Can't exec @PERL@ at fvwm-menu-desktop.in line 1.
>
> Just reviewed "man perlrun". If there's a solution, it isn't
> obvious to me.
It's because perl treats #! specifically as special as the first line in a
file, and the first line is:
#!@PERL@
There's plenty of examples of this in other perl scripts in FVWM. We could
just use "env", but there's some distributions which have it in either /bin
or /usr/bin.
Instead, I just tend to do this:
cd fvwm/bin
rm fvw-menu-directory ; make
Which does nothing more than interpolate out #!@PERL@ in this case, but I
still find it a useful step when debugging. :)
-- Thomas Adam
--
"Deep in my heart I wish I was wrong. But deep in my heart I know I am
not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)