Subversion Repositories DevTools

Rev

Rev 311 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 311 Rev 313
Line 447... Line 447...
447
use Exporter;
447
use Exporter;
448
use File::Spec;
448
use File::Spec;
449
 
449
 
450
@EXPORT = qw(&pod2usage);
450
@EXPORT = qw(&pod2usage);
451
BEGIN {
451
BEGIN {
452
    if ( $] >= 5.005_58 ) {
-
 
453
       require Pod::Text;
-
 
454
       @ISA = qw( Pod::Text );
-
 
455
    }
-
 
456
    else {
-
 
457
       require Pod::PlainText;
452
       require Pod::PlainText;
458
       @ISA = qw( Pod::PlainText );
453
       @ISA = qw( Pod::PlainText );
459
    }
-
 
460
}
454
}
461
 
455
 
462
require Pod::Select;
456
require Pod::Select;
463
 
457
 
464
##---------------------------------------------------------------------------
458
##---------------------------------------------------------------------------
Line 467... Line 461...
467
## Function definitions begin here
461
## Function definitions begin here
468
##---------------------------------
462
##---------------------------------
469
 
463
 
470
sub pod2usage {
464
sub pod2usage {
471
    local($_) = shift;
465
    local($_) = shift;
472
    my %opts;
466
    my %opts ;
473
    ## Collect arguments
467
    ## Collect arguments
474
    if (@_ > 0) {
468
    if (@_ > 0) {
475
        ## Too many arguments - assume that this is a hash and
469
        ## Too many arguments - assume that this is a hash and
476
        ## the user forgot to pass a reference to it.
470
        ## the user forgot to pass a reference to it.
477
        %opts = ($_, @_);
471
        %opts = ($_, @_);
Line 490... Line 484...
490
    else {
484
    else {
491
        ## User passed in a message to print before issuing usage.
485
        ## User passed in a message to print before issuing usage.
492
        $_  and  $opts{'-message'} = $_;
486
        $_  and  $opts{'-message'} = $_;
493
    }
487
    }
494
 
488
 
-
 
489
    #
-
 
490
    #   Defaults
-
 
491
    #   Don't use perldoc - it creates different output
-
 
492
    #
-
 
493
    $opts{-noperldoc} ||= 1;
-
 
494
 
495
    ## Need this for backward compatibility since we formerly used
495
    ## Need this for backward compatibility since we formerly used
496
    ## options that were all uppercase words rather than ones that
496
    ## options that were all uppercase words rather than ones that
497
    ## looked like Unix command-line options.
497
    ## looked like Unix command-line options.
498
    ## to be uppercase keywords)
498
    ## to be uppercase keywords)
499
    %opts = map {
499
    %opts = map {