С
нашел в доках
#!/bin/sh
#! -*- perl -*- -p
первый раз такое вижу) не понимаю зачем так делать если можно сразу указать перл)
Size: a a a
С
#!/bin/sh
#! -*- perl -*- -p
С
С
SZ
SZ
С
Parsing of the "#!" switches starts wherever "perl" is mentioned in the
line. The sequences "-*" and "- " are specifically ignored so that you
could, if you were so inclined, say
#!/bin/sh
#! -*- perl -*- -p
eval 'exec perl -x -wS $0 ${1+"$@"}'
if 0;
to let Perl see the "-p" switch.
#!/usr/bin/env perl
С
С
SZ
SZ
SZ
SZ
SZ
С
#!/usr/bin/env perlв перле 2 шебанга это типичная ситуация?
SZ
С
$ perldoc perlrun /-x
No documentation found for "/-x".
NAME
perlrun - how to execute the Perl interpreter
SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:*configvar*] ]
[ -cw ] [ -d[t][:*debugger*] ] [ -D[*number/list*] ]
[ -pna ] [ -F*pattern* ] [ -l[*octal*] ] [ -0[*octal/hexadecimal*] ]
[ -I*dir* ] [ -m[-]*module* ] [ -M[-]*'module...'* ] [ -f ]
[ -C [*number/list*] ] [ -S ] [ -x[*dir*] ] [ -i[*extension*] ]
[ [-e|-E] *'command'* ] [ -- ] [ *programfile* ] [ *argument* ]...
DESCRIPTION
The normal way to run a Perl program is by making it directly
executable, or else by passing the name of the source file as an
argument on the command line. (An interactive Perl environment is also
possible--see perldebug for details on how to do that.) Upon startup,
Perl looks for your program in one of the following places:
С
> perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux
(with 76 registered patches, see perl -V for more detail)
С
SZ
#!/bin/sh
Blablabla
Prepare environment
Blablabla
exec perl -x "$0"
exit 255
#!/usr/bin/perl -blablabla
use strict;
Blablabla
__END__
С
Prepare environment
нельзя сделать внутри перл скрипта? реально первый раз вижу такую конструкцию, даже интересно стало поиграть с ней но мне не кажется что она популярная, но если @Pkupt именно с такими и работает то да, первая строка ему не поможет.