Monday, September 13, 2010

Shebang

#!usr/bin/perl
#! is called shebang.

The function of the 'shebang' line is to tell the shell how to execute the file. Under UNIX, this makes sense. Under Win32, the system must already know how to execute the file before it is loaded so the line is not needed.

However, the line is not completely ignored, as it is searched for any switches you may have given Perl (for example -w to turn on warnings).

You may also choose to add the line so your scripts run directly on UNIX without modification, as UNIX boxes probably do need it. Win32 systems do not.

No comments:

Post a Comment