Olego ([info]olego) wrote,
@ 2008-10-08 19:22:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Perl + Batch?
I saw this trick today, and it totally blew my mind. Read the next few lines carefully.

@REM = ' = Perl in Batch = ';
@REM = ' = Read this carefully
@ECHO OFF
perl -w %~dpnx0 %*
goto :EOF
';
print "Hello, now I'm in Perl!\n";


While it's true that `perl -x` can be used to accomplish roughly the same, the trick above is just... beautiful.

(Source: http://www.informit.com/articles/article.aspx?p=29328&seqNum=5)



Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…