use of perlbrew, requires to set an env-var and use #!/usr/bin/env perl
as the shebang of all your perl scripts.
I love perlbrew but I love the shebang more. I could not look at env
at the top of every perl script let alone type it. Shebang is holy and
I found an easy way to preserve it to an acceptable degree and gained a
very handy perlbrew switch. Like many others I have an untouched system perl
and a main perlbrew with tons of cpan modules. My shebang preservation and
toggle switch between system perl and perlbrew perl is achieved by making a
symlink in the root directory called "user" that points to the main perlbrew
sudo ln -s /path/to/perl5/perlbrew/perls/perl-VERSION user
The main perlbrew path is found by typing "which perl" while brewing the main perlbrew perl and ignoring the /bin/perl part at the end. Now there are two shebangs with a single character switch that works everywhere:
#!/usr/bin/perl # system perl
#!/user/bin/perl # perlbrew perl
On my system:
/usr/bin/perl -le 'print $^V'
/user/bin/perl -le 'print $^V'
This symlink has made me very happy! ☺
STOP REINVENTING WHEELS, START BUILDING SPACE ROCKETS!—CPAN