Codebase list libtest-pod-perl / 4605268
Recognize .bat Perl scripts. David E. Wheeler 14 years ago
5 changed file(s) with 43 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
44 META.*
55 MYMETA.*
66 Build
7 *.rej
8 *.orig
99 `configure_requires`.
1010 * Updated `MANIFEST` so that the `README` is actually included in the
1111 distribution.
12 * Now recognizes `.bat` files as Perl files when they contain
13 "--*-Perl-*--" on the first line. Thanks to Olivier 'dolmen' Mengué for
14 the patch (RT #46973).
1215
1316 1.41 - 2010-01-14T20:09:25
1417 * Maintenance transfered to David Wheeler.
252252 my $first = <$fh>;
253253 close $fh;
254254
255 return 1 if defined $first && ($first =~ /^#!.*perl/);
255 return 1 if defined $first && ($first =~ /(?:^#!.*perl)|--\*-Perl-\*--/);
256256
257257 return;
258258 }
1212 @expected = (
1313 File::Spec->catfile( 'blib', 'lib', 'Test', 'Pod.pm' ),
1414 File::Spec->catfile( 't', 'pod', 'good-pod-script.' ),
15 File::Spec->catfile( 't', 'pod', 'good-pod-script.bat' ),
1516 File::Spec->catfile( 't', 'pod', 'good.pod' ),
1617 File::Spec->catfile( 't', 'pod', 'no_pod.pod' ),
1718 );
2223 @expected = qw(
2324 blib/lib/Test/Pod.pm
2425 t/pod/good-pod-script
26 t/pod/good-pod-script.bat
2527 t/pod/good.pod
2628 t/pod/no_pod.pod
2729 );
0 @rem = '--*-Perl-*--
1 @echo off
2 if "%OS%" == "Windows_NT" goto WinNT
3 perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
4 goto endofperl
5 :WinNT
6 perl -x -S %0 %*
7 if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
8 if %errorlevel% == 9009 echo You do not have Perl in your PATH.
9 if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
10 goto endofperl
11 @rem ';
12 #!/usr/bin/perl
13 #line 15
14
15 =head1 NAME
16
17 This is a pretend script that we need to check
18
19 =head1 DESCRIPTION
20
21 This is a pod file without errors.
22
23 =head1 AUTHOR
24
25 Andy Lester, garbage-address@aol.com
26
27 =head1 COPYRIGHT
28
29 Copyright 2004, Andy Lester
30
31 =cut
32
33 __END__
34 :endofperl