Mail-ExpandAliases

 view release on metacpan or  search on metacpan

ExpandAliases.pm  view on Meta::CPAN

            $DEBUG = 1;
        }
        elsif (-f "$x") {
            unshift @POSSIBLE_ALIAS_FILES, $x;
        }
    }
}

sub new {
    my ($class, $file) = @_;
    my $self = bless [ { }, { }, "" ] => $class;

    $self->[ FILE ] = (grep { -e $_ && -r _ }
                       ($file, @POSSIBLE_ALIAS_FILES))[0];
    $self->debug("Using alias file " . $self->[ FILE ]);
    $self->init();

    return $self;
}

sub debug {

ExpandAliases.pm  view on Meta::CPAN

# multiple lines.
#
# XXX I suppose I could simply subclass IO::File, and rename next
# to readline.

sub new {
    my $class = shift;
    my $file = shift;
    my $fh = IO::File->new($file);

    my $self = bless [ $fh, '' ] => $class;
    $self->[ BUFFER ] = <$fh>
        if $fh;

    return $self;
}

sub next {
    my $self = shift;
    my $buffer = $self->[ BUFFER ];
    my $fh = $self->[ FH ];



( run in 0.275 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )