IO-File-WithPath

 view release on metacpan or  search on metacpan

lib/IO/File/WithPath.pm  view on Meta::CPAN


sub new {
    my $class = shift;
    my $path  = File::Spec->rel2abs(shift);

    my $io = IO::File->new($path, @_);

    # symboltable hack
    ${*$io}{+__PACKAGE__} = $path;

    bless $io => $class;
}

sub path { 
    my $io = shift;
    ${*$io}{+__PACKAGE__};
}


1;
__END__



( run in 0.247 second using v1.01-cache-2.11-cpan-496ff517765 )