Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1107443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:56:14+00:00 2026-05-17T01:56:14+00:00

I’m working with SGE (Sun Grid Engine) to submit jobs to a grid. I

  • 0

I’m working with SGE (Sun Grid Engine) to submit jobs to a grid. I also use perlbrew to manage my installed Perl versions.
I wrote some short sh scripts that I use to run a perl script which requires a specific Perl version (5.12.2), which look something like this:

#!/bin/bash
#$-S /bin/bash

source /home/dave/.bash_profile
/home/dave/perl5/perlbrew/bin/perlbrew switch perl-5.12.2

/home/dave/scripts/proc_12.pl --in=/home/dave/in/in.store --dir=/home/dave/in/dir2 --params=/home/dave/in/params.p

Now, when I submit a single job everything works fine, but when I submit many, I start getting perlbrew related error messages, like:

ln: creating symbolic link `current' to `perl-5.12.2': File exists
ln: creating symbolic link `/home/dave/perl5/perlbrew/bin/cpan' to `/home/dave/perl5/perlbrew/perls/current/bin/cpan': File exists
ln: creating symbolic link `/home/dave/perl5/perlbrew/bin/cpan2dist' to `/home/dave/perl5/perlbrew/perls/current/bin/cpan2dist': File exists
ln: cannot remove `/home/dave/perl5/perlbrew/bin/cpanp': No such file or directory
ln: cannot remove `/home/dave/perl5/perlbrew/bin/enc2xs': No such file or directory
ln: cannot remove `/home/dave/perl5/perlbrew/bin/find2perl': No such file or directory

So I guess the /home/dave/perl5/perlbrew/bin/perlbrew switch perl-5.12.2 line is causing the problems.

What can I do?

How can I make my script run using perl-5.12.2 (the default is 5.8.8)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:56:15+00:00Added an answer on May 17, 2026 at 1:56 am

    I don’t recommend putting the perlbrew switch perl-5.12.2 in any script you run. Its really only for command line usage.

    If you need a script to use a specific version of Perl then either give it the full perlbrew path on the shebang:

    #!/home/dave/perl5/perlbrew/perls/perl-5.12.2/bin/perl
    
    use 5.012;
    use warnings;
    ...
    

    Then make sure its executable and run like so:

    chmod +x your_perl_program.pl
    ./your_perl_program.pl
    

    Or alternatively use the full pathname to the perl binary in your script:

    #!/bin/bash
    
    /home/dave/perl5/perlbrew/perls/perl-5.12.2/bin/perl your_perl_program.pl
    

    BTW, you will have potential production and security issues if you run anything unqualified in your scripts or perl programs. For eg:

    #!/bin/sh
    
    # security risk
    perl some_script.pl
    
    # and not just perl
    tar cvf archive.tar *.txt
    
    # production risk
    /home/dave/perl5/perlbrew/bin/perl some_other_script.pl
    

    The first two are bad because it will pick up the first perl & tar it finds in your path. So this depends on $PATH setting and this could become a security risk. The last is also not good because its reliant on what perl perlbrew is currently switched to at the point in time its run 🙁

    So doing this can be a potential production & security nightmare. Instead the above should be written like this:

    #!/bin/sh
    
    # fully qualified now.  Uses OS provided perl
    /usr/bin/perl some_script.pl
    
    # ditto
    /usr/bin/tar cvf archive.tar *.txt
    
    # this needs to run in perl 5.12.2
    /home/dave/perl5/perlbrew/perls/perl-5.12.2/bin/perl some_other_script.pl
    

    Hope that all makes sense?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.