Skip to content

Instantly share code, notes, and snippets.

@gardejo
Created May 29, 2010 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gardejo/418115 to your computer and use it in GitHub Desktop.
Save gardejo/418115 to your computer and use it in GitHub Desktop.
Force them to run your script with the intentional interpreter!
@rem= '
@echo off
setlocal EnableExtensions EnableDelayedExpansion
if "%strawberry%" equ "" (
set strawberry=\\{OUR_SHARED_DIRECTORY}\env\perl\5.12.0.1\
)
set path=%path%;%strawberry%\c\bin;%strawberry%\perl\bin;%strawberry%\perl\site\bin
set perl=%strawberry%\perl\bin\perl.exe
%perl% "%~dpnx0" %*
if %errorlevel% gtr 0 (
color ce
echo.
echo 異常終了しました。
echo エラー内容を確認して、任意のキーを押下して実行を終了してください。
pause > nul
color
)
exit /b
@rem ';
# ****************************************************************
# Perl section goes here!
# ****************************************************************
use 5.012_000;
use strict;
use warnings;
{
package Foo;
use namespace::autoclean;
use Moose;
...
__PACKAGE__->meta->make_immutable;
1;
}
main()
unless caller();
sub main {
...
}
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment