Question

I was looking at the source code for the CPAN Perl module Digest::Perl::MD5 and noticed that it has the she bang #! /usr/bin/false. Here's the first few lines of Digest/Perl/MD5.pm ...

#! /usr/bin/false
#
# $Id: MD5.pm,v 1.19 2004/02/14 02:25:32 lackas Exp $
#

package Digest::Perl::MD5;
use strict;
use integer;
use Exporter;
use vars qw($VERSION @ISA @EXPORTER @EXPORT_OK);

... why would the author of Digest::Perl::MD5 use #! /usr/bin/false? And what if my system does not have /usr/bin/false but has /bin/false instead?

Was it helpful?

Solution

why would the author of Digest::Perl::MD5 use #! /usr/bin/false?

So that if someone tried to use the module as an executable (Perl $ ./MD5.pm), it would quietly die instead of trying to execute the module as a program.

And what if my system does not have /usr/bin/false but has /bin/false instead?

Then it will nosily die complaining that it couldn't find /usr/bin/false if anyone tried that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top