Perl problems

ZIYAD A. M. AL-BATLY zamb at saudi.net.sa
Fri May 13 14:08:04 UTC 2005


On Fri, 2005-05-13 at 13:09 +0200, Alf-Ivar Holm wrote:
> ...
> When sh¹ is started with a file name as argument, it tries to parse
> the file as shell commands.  It does _not_ look for magic strings (!#
> in this case) in the file, it just try to execute each line, where the
> first line will be taken for a comment in sh.
True.  My fault.  That's is the responsibility of the loader (ld) not
the shell.  The correct thing would be (as you said): “perl secede2.pl”.

> ...
> Indeed, the executable bit is not important in this case, but the
> command "sh secede2.pl" will most probably fail big time, since Perl
> commands are given to a shell interpreter.  "perl secede2.pl" on the
> other hand, is the correct way of a non-magic run of the perl program.
> 
> 	Affi
> 
> ¹) For Ubuntu, sh is actually a link to bash(1) and not Bourne Shell,
> which is what sh usually designates.
> 
True.  But “bash” will run in “sh” compatibility mode (that is, without
any new features introduced with “bash”) if called as “sh”.

Thanks for the corrections.
Ziyad.




More information about the ubuntu-users mailing list