Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I wonder why Makefile.PL uses uppercase extention 'PL' instead of lowercase 'pl'. Is there any reason to do this?

  • Comment on Why Makefile.PL uses uppercase extension?

Replies are listed 'Best First'.
Re: Why Makefile.PL uses uppercase extension?
by Anonymous Monk on Dec 21, 2014 at 10:21 UTC
Re: Why Makefile.PL uses uppercase extension?
by syphilis (Archbishop) on Dec 21, 2014 at 13:58 UTC
    I wonder why Makefile.PL uses uppercase extention 'PL'

    For someone, such as myself, who likes to build modules the ol' fashioned manual way, even the capital 'M' is a PITA.
    Wouldn't it be nice if you could just type perl makefile.pl

    Well ... on Windows perl makefile.pl works fine. It's only the case-sensitive systems that barf at such commands.
    I haven't tried it out, but I suspect that if the distro had a 'makefile.pl' instead of a 'Makefile.PL' then the automated cpan/cpanm-type installations would fail.
    Has anybody tested that ?

    Cheers,
    Rob
      It's interesting that GitHub recently had to release a security patch for Windows and MacOSX, because the case-insensitive file systems on those OS's would allow a user's own 'git.config' to be overwritten when downloading a code distro from a malicious source (potentially allowing a remote user to run arbitrary commands on the victim's machine).

      Has anybody tested that ?

      Well, if the file system is case insensitive, makefile.pl will work, but MakeMaker will install makefile.pl along with the .pm

      See

      Naturally it won't work on case sensitive filesystems

Re: Why Makefile.PL uses uppercase extension?
by MidLifeXis (Monsignor) on Dec 22, 2014 at 13:45 UTC

      They are usually converted into shell scripts, not just copied.

      Unix: (.pl removed)

      #!/path/to/perl/used/to/install/bin/perl eval 'exec /path/to/perl/used/to/install/bin/perl -w -S $0 ${1+"$@"}' if 0; # not running under some shell ...[ script contents here ]...

      Windows: (.pl ⇒ .bat)

      @rem = '--*-Perl-*-- @echo off if "%OS%" == "Windows_NT" goto WinNT perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl :WinNT perl -x -S %0 %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl @rem '; #!/usr/bin/perl -w #line 15 ...[ script contents here ]... __END__ :endofperl
Re: Why Makefile.PL uses uppercase extension?
by ikegami (Patriarch) on Dec 23, 2014 at 20:59 UTC

    In a distribution, .pl is used for scripts that are meant to be installed. .PL files are files used by the installer, but not meant to be installed.