What is the recommended way to package perl scripts for CPAN (and CorporatePAN)?

Posted by szabgab on Stack Overflow See other posts from Stack Overflow or by szabgab
Published on 2010-12-21T08:26:38Z Indexed on 2010/12/21 19:54 UTC
Read the original article Hit count: 212

Filed under:
|
|
|
|

Recently I looked at a module on CPAN that comes with a script to be installed which made me wonder. What is the recommended way to include a script in a package that should end up on the public CPAN and if there is any different recommendation for packages that would be released on an in-house CPAN server?

The script starts like this:

#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
  if 0; # not running under some shell

Two questions

Do I understand correctly the eval part is unnecessary? That will be embedded by the CPAN client during installation and it will be very different when installing on Windows.

What is the recommended sh-bang line? Would that be

#!/usr/bin/env perl

instead of the above?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about linux