;= @echo off ;= rem Call DOSKEY and use this file as the macrofile ;= %SystemRoot%\system32\DOSKEY /listsize=1024 /macrofile=%0% ;= rem In batch mode, jump to the end of the file ;= goto end ;= rem ****************************************************************** ;= rem * Filename: DOSKEY-M1.cmd ;= rem * Version: 2.0 ;= rem * Author: Soren Andersen ;= rem * Purpose: Some useful perl 1-liners ;= rem * license/terms of use/modification/redist: same as Perl ;= rem * Last modified: Wed 28 Dec 2011 ;= rem * History: ;= rem ****************************************************************** ;= rem PMTEST: Test for use of a Perl module PMTEST=perl -le "do{$modn=$_;s!::!/!g;$_.=q[.pm];do{print qq[$modn is not installed.];next} unless eval qq#require(\"$_\");1# && !$@;$modv=defined(${$modn.q[::VERSION]}) ? ${$modn.q[::VERSION]}:q{[version undefined]};$numtyp=2>$modv=~tr/.// ?'%s':'% 6d';printf qq[ %-*s $numtyp in %s\n],(length>30 ? 5+length:15+length),$modn,$modv,$INC{$_}}for @ARGV;" $* ;= rem SPECIALFOLDERS: Display Well-Known Folder pathnames SPECIALFOLDERS=perl -MWin32 -e "my @ds=grep {/CSIDL_/} @{ [keys %Win32::] }; do {printf qq/%24s=>%s\n/, substr($_=>6),Win32::GetFolderPath(&{$Win32::{$_}})} for map {$_->[0]} grep {(0+@ARGV ? $_->[0]=~m#$ARGV[0]#i : 1)} sort {$a->[1] <=> ${b}->[1]} map {[$_,&{$Win32::{$_}}]} @ds" $* ;= :end