On 12-06-02 12:23 PM, sono...@fannullone.us wrote:
Is it possible to use a shebang line, like #!/usr/bin/env perl, so that
scripts will use the currently selected version of Perl with perlbrew?
According to the help, it appears that perlbrew only changes the version for
the CLI:
COMMAND: SWITCH
Usage: perlbrew switch [<name> ]
Switch to the given version, and makes it the default for this and all
future terminal sessions.
Right now, I'm hardcoding the version of Perl in my scripts, like:
#!/Users/marc/perl5/perlbrew/perls/perl-5.16.0/bin/perl
but it's an inconvenience to change the shebang line in all my scripts just to
try a different version. It would be nice if perlbrew took care of that as
well.
It seems like it should do this automatically, so maybe I don't have
something set up correctly, but googling hasn't helped.
Thanks,
Marc
I don't know anything inside perlbrew that will help, but you could do this:
sudo ln -s /Users/marc/perl5/perlbrew/perls/perl-5.16.0/bin/perl
/usr/local//bin/perl
Then change your shebangs to: #!/usr/local/bin/perl
This has the advantage of not having to run your profile to get the
correct version of perl and when you upgrade, you just have to change
the symlink to upgrade all your scripts.
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
_Perl links_
official site : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help : http://perlmonks.org/
documentation : http://perldoc.perl.org/
news : http://perlsphere.net/
repository : http://www.cpan.org/
blog : http://blogs.perl.org/
regional groups : http://www.pm.org/
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/