IO-File-WithFilename-0.01/0000755000175000017500000000000011457633775015716 5ustar ifomichevifomichevIO-File-WithFilename-0.01/MANIFEST0000644000175000017500000000025011457633775017044 0ustar ifomichevifomichevChanges Makefile.PL MANIFEST README t/IO-File-WithFilename.t lib/IO/File/WithFilename.pm META.yml Module meta-data (added by MakeMaker) IO-File-WithFilename-0.01/t/0000755000175000017500000000000011457633775016161 5ustar ifomichevifomichevIO-File-WithFilename-0.01/t/IO-File-WithFilename.t0000644000175000017500000000055311457632727022103 0ustar ifomichevifomichevuse File::Temp; use Test::More tests => 5; BEGIN { use_ok('IO::File::WithFilename') }; my $mode = eval { O_RDONLY }; ok(defined $mode, 'export'); my $temp_fh = File::Temp->new; my $file = $temp_fh->filename; my $fh = IO::File::WithFilename->new($file, $mode); ok($fh, 'new'); is($fh->filename, $file, 'filename method'); is("$fh", $file, 'stringification'); IO-File-WithFilename-0.01/META.yml0000644000175000017500000000111711457633775017167 0ustar ifomichevifomichev--- #YAML:1.0 name: IO-File-WithFilename version: 0.01 abstract: filehandles that know their origin author: - Ivan Fomichev license: unknown distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 build_requires: ExtUtils::MakeMaker: 0 requires: File::Temp: 0.22 IO::File: 1.14 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.55_02 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 IO-File-WithFilename-0.01/Changes0000644000175000017500000000026111457623401017171 0ustar ifomichevifomichevRevision history for Perl extension IO::File::WithFilename. 0.01 Wed Oct 20 21:29:37 2010 - original version; created by h2xs 1.23 with options -Xn IO::File::WithFilename IO-File-WithFilename-0.01/README0000644000175000017500000000074211457633664016576 0ustar ifomichevifomichevINSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: File::Temp IO::File COPYRIGHT AND LICENCE Copyright (C) 2010 by Ivan Fomichev This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available. IO-File-WithFilename-0.01/lib/0000755000175000017500000000000011457633775016464 5ustar ifomichevifomichevIO-File-WithFilename-0.01/lib/IO/0000755000175000017500000000000011457633775016773 5ustar ifomichevifomichevIO-File-WithFilename-0.01/lib/IO/File/0000755000175000017500000000000011457633775017652 5ustar ifomichevifomichevIO-File-WithFilename-0.01/lib/IO/File/WithFilename.pm0000644000175000017500000000321011457633121022541 0ustar ifomichevifomichevpackage IO::File::WithFilename; use 5.010001; use strict; use warnings; use IO::File; require Exporter; use overload '""' => \&filename, fallback => 1; our $VERSION = '0.01'; our @ISA = qw/IO::File Exporter/; our @EXPORT = @IO::File::EXPORT; sub open { my $self = shift; ${*$self} = $_[0]; # store the filename in the scalar slot $self->SUPER::open(@_); } sub filename { my $self = shift; return ${*$self}; } 1; __END__ =head1 NAME IO::File::WithFilename - filehandles that know their origin =head1 SYNOPSIS use IO::File::WithFilename; my $fh = IO::File::WithFilename->new('../movies/kin-dza-dza.ogg', O_RDONLY); print $fh->filename, "\n"; print "$fh\n"; # same as above =head1 DESCRIPTION This module does everything that C does, but implements C method, that C objects have. It lets you write the code that is ignorant of what classes of objects it works with. If you want to check if it is safe to call C method, you are recommended to call C method rather than to check an object's inheritance: print $obj->filename, "\n" if eval { $obj->can('filename') }; =head2 EXPORT Same as C, i. e. C constants from the C module (if this module is available). =head1 SEE ALSO L, L =head1 AUTHOR Ivan Fomichev, Eifomichev@cpan.orgE =head1 COPYRIGHT AND LICENSE Copyright (C) 2010 by Ivan Fomichev This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available. =cut IO-File-WithFilename-0.01/Makefile.PL0000644000175000017500000000062711457631260017660 0ustar ifomichevifomichevuse 5.010001; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'IO::File::WithFilename', VERSION_FROM => 'lib/IO/File/WithFilename.pm', PREREQ_PM => { 'File::Temp' => '0.22', 'IO::File' => '1.14', }, ($] >= 5.005 ? (ABSTRACT_FROM => 'lib/IO/File/WithFilename.pm', AUTHOR => 'Ivan Fomichev ') : ()), );