| 1 | package IO::File::WithFilename; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use IO::File; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | require Exporter; | |
| 10 | |||
| 11 | 1 | ▶ | use overload '""' => \&filename, fallback => 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 1 | our $VERSION = '0.01'; | |
| 14 | |||
| 15 | 1 | our @ISA = qw/IO::File Exporter/; | |
| 16 | |||
| 17 | 1 | our @EXPORT = @IO::File::EXPORT; | |
| 18 | |||
| 19 | 1 | ▶ | sub open { |
|
Subroutine
open: called CC=1 SCAR=0.0
Pod
documented
| |||
| 20 | 1 | my $self = shift; | |
| 21 | 1 | ${*$self} = $_[0]; # store the filename in the scalar slot | |
| 22 | 1 | $self->SUPER::open(@_); | |
| 23 | } | ||
| 24 | |||
| 25 | 3 | ▶ | sub filename { |
|
Subroutine
filename: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 26 | 3 | my $self = shift; | |
| 27 | 3 | return ${*$self}; | |
| 28 | } | ||
| 29 | |||
| 30 | 1 | 1; | |
| 31 | __END__ | ||