Quoth "doni" <>:
> Hi,
>
> I want to write a program that does check the appropriate system path
> for perl in FreeBSD and Linux.
>
> The path where I have it in FreeBSD is
> #! /usr/local/bin/perl
>
> and the path where it is in Linux is
> #! /usr/bin/perl
>
> I wanted the program to check for the uname of the system and choose
> the appropriate path. Can anyone tell me how can I have my program
> check this.
This is not a Perl question. The path on the #! line is not used by
perl, but by your operating system. In general, there is no way to put
any logic into that line, though
#!/usr/bin/env perl
may do what you want. Note that it will use the perl in your current
PATH, which may be a security risk. As others have said, you are much
better off arranging for perl to be available as /usr/bin/perl, or
writing some sort of installation script that changes the #! line.
Ben
--
For far more marvellous is the truth than any artists of the past imagined!
Why do the poets of the present not speak of it? What men are poets who can
speak of Jupiter if he were like a man, but if he is an immense spinning
sphere of methane and ammonia must be silent? [Feynmann]