Skip to content

Instantly share code, notes, and snippets.

@mamemomonga
Last active December 21, 2015 05:18
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 mamemomonga/6255796 to your computer and use it in GitHub Desktop.
Save mamemomonga/6255796 to your computer and use it in GitHub Desktop.
Windows7 x64 バッチファイルからActive Perl(64bit)でHello World!
@echo off
rem ---------------------------------------------------------------------------
rem Windows7 x64 バッチファイルからActive Perl(64bit)でHello World!
rem Shift_JIS(cp932)で保存すること
rem ---------------------------------------------------------------------------
set OPATH=%PATH%
set PATH=C:\Perl64\bin;%PATH%
perl -x -S %0 %*
goto endofperl
@rem ';
#!perl
use strict;
use warnings;
use encoding 'cp932';
use English;
print "Hello World!\n";
print "こんにちは\n";
foreach(qw( EXECUTABLE_NAME PERL_VERSION OSNAME )) {
print "$_: ".(eval "\$$_")."\n";
}
for(my $i=0;$i<=$#ARGV;$i++) {
print "ARGV[$i]: $ARGV[$i]\n";
}
__END__
:endofperl
set PATH=%OPATH%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment