[Moose-commits] r7206 - in MooseX-GlobRef-Object/trunk: eg
lib/MooseX/GlobRef lib/MooseX/GlobRef/Meta
dexter at code2.0beta.co.uk
dexter at code2.0beta.co.uk
Tue Dec 30 22:34:09 GMT 2008
Author: dexter
Date: 2008-12-30 14:34:09 -0800 (Tue, 30 Dec 2008)
New Revision: 7206
Modified:
MooseX-GlobRef-Object/trunk/eg/extends_object.pl
MooseX-GlobRef-Object/trunk/eg/use_metaclass.pl
MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm
MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm
Log:
* Minor POD and examples changes.
Modified: MooseX-GlobRef-Object/trunk/eg/extends_object.pl
===================================================================
--- MooseX-GlobRef-Object/trunk/eg/extends_object.pl 2008-12-30 22:26:07 UTC (rev 7205)
+++ MooseX-GlobRef-Object/trunk/eg/extends_object.pl 2008-12-30 22:34:09 UTC (rev 7206)
@@ -6,7 +6,7 @@
extends 'MooseX::GlobRef::Object';
-has 'filename' => (
+has 'file' => (
is => 'ro',
isa => 'Str',
required => 1,
@@ -15,7 +15,7 @@
sub open {
my $fh = shift;
my $hashref = ${*$fh};
- open $fh, $hashref->{filename} or confess "cannot open";
+ open $fh, $hashref->{file} or confess "cannot open";
return $fh;
}
@@ -24,10 +24,10 @@
return readline $fh;
}
-my $io = My::IO->new( filename => '/etc/passwd' );
+my $io = My::IO->new( file => $ARGV[0] || die "Usage: $0 *file*\n" );
print "::::::::::::::\n";
-print $io->filename, "\n";
+print $io->file, "\n";
print "::::::::::::::\n";
$io->open;
print $io->getlines;
Modified: MooseX-GlobRef-Object/trunk/eg/use_metaclass.pl
===================================================================
--- MooseX-GlobRef-Object/trunk/eg/use_metaclass.pl 2008-12-30 22:26:07 UTC (rev 7205)
+++ MooseX-GlobRef-Object/trunk/eg/use_metaclass.pl 2008-12-30 22:34:09 UTC (rev 7206)
@@ -8,7 +8,7 @@
use Moose;
-has 'filename' => (
+has 'file' => (
is => 'ro',
isa => 'Str',
required => 1,
@@ -17,7 +17,7 @@
sub open {
my $fh = shift;
my $hashref = ${*$fh};
- open $fh, $hashref->{filename} or confess "cannot open";
+ open $fh, $hashref->{file} or confess "cannot open";
return $fh;
}
@@ -26,10 +26,10 @@
return readline $fh;
}
-my $io = My::IO->new( filename => '/etc/passwd' );
+my $io = My::IO->new( file => $ARGV[0] || die "Usage: $0 *file*\n" );
print "::::::::::::::\n";
-print $io->filename, "\n";
+print $io->file, "\n";
print "::::::::::::::\n";
$io->open;
print $io->getlines;
Modified: MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm 2008-12-30 22:26:07 UTC (rev 7205)
+++ MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm 2008-12-30 22:34:09 UTC (rev 7206)
@@ -15,23 +15,23 @@
use Moose;
- has 'filename' => ( is => 'ro', isa => 'Str', required => 1 );
+ has 'file' => ( is => 'ro', isa => 'Str', required => 1 );
sub open {
my $fh = shift;
my $hashref = ${*$fh};
- open $fh, $hashref->{filename} or confess "cannot open";
+ open $fh, $hashref->{file} or confess "cannot open";
return $fh;
- }
+ };
sub getlines {
my $fh = shift;
return readline $fh;
- }
+ };
- my $io = new My::IO filename=>'/etc/passwd';
+ my $io = My::IO->new( file => '/etc/passwd' );
print "::::::::::::::\n";
- print $io->filename, "\n";
+ print $io->file, "\n";
print "::::::::::::::\n";
$io->open;
print $io->getlines;
Modified: MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm 2008-12-30 22:26:07 UTC (rev 7205)
+++ MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm 2008-12-30 22:34:09 UTC (rev 7206)
@@ -14,12 +14,12 @@
extends 'MooseX::GlobRef::Object';
- has 'filename' => ( is => 'ro', isa => 'Str', required => 1 );
+ has 'file' => ( is => 'ro', isa => 'Str', required => 1 );
sub open {
my $fh = shift;
my $hashref = ${*$fh};
- open $fh, $hashref->{filename} or confess "cannot open";
+ open $fh, $hashref->{file} or confess "cannot open";
return $fh;
}
@@ -28,9 +28,9 @@
return readline $fh;
}
- my $io = My::IO->new( filename=>'/etc/passwd' );
+ my $io = My::IO->new( file => '/etc/passwd' );
print "::::::::::::::\n";
- print $io->filename, "\n";
+ print $io->file, "\n";
print "::::::::::::::\n";
$io->open;
print $io->getlines;
More information about the Moose-commits
mailing list