[Gllug] Perl 'running' python and bash

Ian Norton-Badrul bredroll at darkspace.org.uk
Sun May 1 16:45:32 UTC 2005


Mark Hill wrote:
> Hi,
> 
> I've accidentally found that perl will 'run' python, bash and possibly
> other scripts. Through a bit of investigation, it seems that perl will
> look at the shebang line of a given script and call the appropriate
> interpretter. E.G: A python script consisting of:
> 
> #!/usr/bin/python
> print "Hello"
> 
> Can be executed as perl file.py
> 
> Is there any reason why perl does this, or was it implemented just for
> fun? 

Seems a little wierd :-), but,
that shebang line is there for the invoking program (usually the shell)
to decide what to run, apache and things like that also listen here,

afaik csh, tcsh, zsh and tclsh will also do the same.

If you are feeling particularly wierd then you 'can' use perl as the
shell, (perlsh?)

Ian



-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list