[Moose-commits] r7413 - in File-Stat-Moose/trunk: . eg
lib/Exception lib/File/Stat lib/MooseX/Types t/tlib/File/Stat xt
dexter at code2.0beta.co.uk
dexter at code2.0beta.co.uk
Thu Jan 29 16:57:42 GMT 2009
Author: dexter
Date: 2009-01-29 08:57:42 -0800 (Thu, 29 Jan 2009)
New Revision: 7413
Added:
File-Stat-Moose/trunk/xt/cover.pl
Removed:
File-Stat-Moose/trunk/xt/cover.sh
Modified:
File-Stat-Moose/trunk/
File-Stat-Moose/trunk/Changes
File-Stat-Moose/trunk/MANIFEST
File-Stat-Moose/trunk/eg/stat.pl
File-Stat-Moose/trunk/lib/Exception/IO.pm
File-Stat-Moose/trunk/lib/File/Stat/Moose.pm
File-Stat-Moose/trunk/lib/MooseX/Types/CacheFileHandle.pm
File-Stat-Moose/trunk/lib/MooseX/Types/OpenHandle.pm
File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm
File-Stat-Moose/trunk/xt/benchmark.pl
File-Stat-Moose/trunk/xt/profile.pl
File-Stat-Moose/trunk/xt/trace.pl
Log:
* Use accessors everywhere if attribute "strict_accessors" is true value.
* Use "CORE::stat" instead "CORE::lstat" if file is GLOB reference.
Property changes on: File-Stat-Moose/trunk
___________________________________________________________________
Name: svn:ignore
- *.bak
*.deb
*.gz
*.ppd
*.tgz
*.tmp
.includepath
.project
.settings
Build
Debian_CPANTS.txt
File-Stat-Moose-*
LICENSE
META.yml
Makefile.PL
README
_build
blib
cover_db
+ *.bak
*.deb
*.gz
*.ppd
*.tgz
*.tmp
.includepath
.project
.settings
Build
Debian_CPANTS.txt
File-Stat-Moose-*
LICENSE
META.yml
Makefile.PL
README
_build
blib
cover_db
tmon.out
Modified: File-Stat-Moose/trunk/Changes
===================================================================
--- File-Stat-Moose/trunk/Changes 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/Changes 2009-01-29 16:57:42 UTC (rev 7413)
@@ -1,4 +1,12 @@
------------------------------------------------------------------------
+0.06 | Piotr Roszatycki <dexter at debian.org> | 2009-01-29
+
+Changes:
+
+* Use accessors everywhere if attribute "strict_accessors" is true value.
+* Use "CORE::stat" instead "CORE::lstat" if file is GLOB reference.
+
+------------------------------------------------------------------------
0.0501 | Piotr Roszatycki <dexter at debian.org> | 2009-01-25
Changes:
Modified: File-Stat-Moose/trunk/MANIFEST
===================================================================
--- File-Stat-Moose/trunk/MANIFEST 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/MANIFEST 2009-01-29 16:57:42 UTC (rev 7413)
@@ -19,7 +19,7 @@
xt/benchmark.pl
xt/consistent_version_numbers.t
xt/copyright.t
-xt/cover.sh
+xt/cover.pl
xt/distribution.t
xt/kwalitee.t
xt/minimumversion.t
Modified: File-Stat-Moose/trunk/eg/stat.pl
===================================================================
--- File-Stat-Moose/trunk/eg/stat.pl 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/eg/stat.pl 2009-01-29 16:57:42 UTC (rev 7413)
@@ -5,8 +5,9 @@
use File::Stat::Moose;
--f $ARGV[0] or die "Usage: $0 filename\n";
-my $st = File::Stat::Moose->new( file => \*_ );
+my $file = shift @ARGV;
+-f $file or die "Usage: $0 filename\n";
+my $st = File::Stat::Moose->new( file => $file, @ARGV );
print "Size: ", $st->size, "\n"; # named field
print "Blocks: ". $st->[12], "\n"; # numbered field
Modified: File-Stat-Moose/trunk/lib/Exception/IO.pm
===================================================================
--- File-Stat-Moose/trunk/lib/Exception/IO.pm 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/lib/Exception/IO.pm 2009-01-29 16:57:42 UTC (rev 7413)
@@ -33,7 +33,7 @@
use strict;
use warnings;
-our $VERSION = '0.0501';
+our $VERSION = '0.06';
use Exception::Base 0.21 (
Modified: File-Stat-Moose/trunk/lib/File/Stat/Moose.pm
===================================================================
--- File-Stat-Moose/trunk/lib/File/Stat/Moose.pm 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/lib/File/Stat/Moose.pm 2009-01-29 16:57:42 UTC (rev 7413)
@@ -9,8 +9,7 @@
=head1 SYNOPSIS
use File::Stat::Moose;
- open my $fh, '/etc/passwd';
- $st = File::Stat::Moose->new( file => $fh );
+ $st = File::Stat::Moose->new( file => '/etc/passwd' );
print "Size: ", $st->size, "\n"; # named attribute
print "Blocks: ". $st->[12], "\n"; # numbered attribute
@@ -29,7 +28,7 @@
use strict;
use warnings FATAL => 'all';
-our $VERSION = '0.0501';
+our $VERSION = '0.06';
use Moose;
@@ -46,7 +45,9 @@
# atime, ctime, mtime attributes
use DateTime;
+use Scalar::Util 'reftype';
+
use Exception::Base (
'+ignore_package' => [ __PACKAGE__, qr/^File::Spec(::|$)/, 'Sub::Exporter', qr/^Moose::/, qr/^Class::MOP::/ ],
);
@@ -100,44 +101,62 @@
# Follow symlink or read symlink itself
has follow => (
- is => 'ro',
- isa => 'Bool',
- default => FALSE,
+ is => 'ro',
+ isa => 'Bool',
+ default => FALSE,
);
# Speeds up stat on Win32
has sloppy => (
- is => 'ro',
- isa => 'Bool',
- default => FALSE,
+ is => 'ro',
+ isa => 'Bool',
+ default => FALSE,
);
-# Numeric informations about a file
-has [ qw{ dev ino mode nlink uid gid rdev size blksize blocks } ] => (
- is => 'ro',
- isa => 'Maybe[Int]',
+# Use accessors rather than direct hash
+has strict_accessors => (
+ is => 'rw',
+ isa => 'Bool',
+ default => FALSE,
);
{
+ foreach my $attr ( qw{ dev ino mode nlink uid gid rdev size blksize blocks } ) {
+
+ # Numeric informations about a file
+ has $attr => (
+ is => 'ro',
+ isa => 'Maybe[Int]',
+ writer => "_set_$attr",
+ );
+ };
+
+};
+
+{
foreach my $attr ( qw{ atime mtime ctime } ) {
+ my $reader = "_get_${attr}_epoch";
+
# Numeric informations about a file (time as unix timestamp)
has "_${attr}_epoch" => (
- isa => 'Maybe[Int]',
+ isa => 'Maybe[Int]',
+ reader => $reader,
+ writer => "_set_${attr}_epoch",
);
# Time as DateTime object (lazy evaluationed)
has $attr => (
- is => 'ro',
- isa => 'Maybe[DateTime]',
- lazy => TRUE,
- default => sub {
- defined $_[0]->{"_${attr}_epoch"}
- ? DateTime->from_epoch( epoch => $_[0]->{"_${attr}_epoch"} )
+ is => 'ro',
+ isa => 'Maybe[DateTime]',
+ lazy => TRUE,
+ default => sub {
+ defined $_[0]->$reader
+ ? DateTime->from_epoch( epoch => $_[0]->$reader )
: undef
},
- reader => $attr,
- clearer => "_clear_$attr",
+ clearer => "_clear_$attr",
+ predicate => "has_$attr",
);
};
@@ -151,7 +170,7 @@
sub BUILD {
my ($self, $params) = @_;
- assert_not_null($self->{file}) if ASSERT;
+ assert_not_null($self->file) if ASSERT;
# Update stat info
$self->stat;
@@ -165,46 +184,93 @@
my $self = shift;
Exception::Argument->throw( message => 'Usage: $st->stat()' ) if @_ > 0 or not blessed $self;
- assert_not_null($self->{file}) if ASSERT;
+ my $file = $self->file;
+ assert_not_null($file) if ASSERT;
# Clear lazy attributes
- delete @{$self}{ qw{ atime mtime ctime } };
-
- local ${^WIN32_SLOPPY_STAT} = $self->{sloppy};
-
- if ($self->{follow}) {
- @{$self}{ qw{ dev ino mode nlink uid gid rdev size _atime_epoch _mtime_epoch _ctime_epoch blksize blocks } }
- = map { defined $_ && $_ eq '' ? undef : $_ }
- CORE::stat $self->{file} or Exception::IO->throw( message => 'Cannot stat' );
+ if ($self->strict_accessors) {
+ foreach my $attr (qw{ atime mtime ctime }) {
+ my $clearer = "_clear_$attr";
+ $self->$clearer;
+ };
}
else {
- no warnings 'io'; # lstat() on filehandle
- @{$self}{ qw{ dev ino mode nlink uid gid rdev size _atime_epoch _mtime_epoch _ctime_epoch blksize blocks } }
- = map { defined $_ && $_ eq '' ? undef : $_ }
- CORE::lstat $self->{file} or Exception::IO->throw( message => 'Cannot lstat' );
+ delete @{$self}{ qw{ _atime_epoch _mtime_epoch _ctime_epoch } };
};
- return $self;
-};
+ local ${^WIN32_SLOPPY_STAT} = $self->sloppy;
+ if ($self->follow or (ref $file || '') eq 'GLOB' or (reftype $file || '') eq 'GLOB') {
+ if ($self->strict_accessors) {
+ my %stat;
+ @stat{ qw{ dev ino mode nlink uid gid rdev size atime mtime ctime blksize blocks } }
+ = map { defined $_ && $_ eq '' ? undef : $_ }
+ CORE::stat $file or Exception::IO->throw( message => 'Cannot stat' );
-# Deprecated
-sub lstat {
- my ($self) = @_;
+ foreach my $attr (qw{ dev ino mode nlink uid gid rdev size blksize blocks }) {
+ my $writer = "_set_$attr";
+ $self->$writer( $stat{$attr} );
+ };
+ foreach my $attr (qw{ atime mtime ctime }) {
+ my $writer = "_set_${attr}_epoch";
+ $self->$writer( $stat{$attr} );
+ };
+ }
+ else {
+ @{$self}{ qw{ dev ino mode nlink uid gid rdev size _atime_epoch _mtime_epoch _ctime_epoch blksize blocks } }
+ = map { defined $_ && $_ eq '' ? undef : $_ }
+ CORE::stat $file or Exception::IO->throw( message => 'Cannot stat' );
+ };
+ }
+ else {
+ no warnings 'io'; # lstat() on filehandle
- ## no critic (RequireCarping)
- warn "Method (File::Stat::Moose->lstat) is deprecated. Use method (stat).";
+ if ($self->strict_accessors) {
+ my %stat;
+ @stat{ qw{ dev ino mode nlink uid gid rdev size atime mtime ctime blksize blocks } }
+ = map { defined $_ && $_ eq '' ? undef : $_ }
+ CORE::lstat $file or Exception::IO->throw( message => 'Cannot stat' );
- confess "Cannot call method (File::Stat::Moose->lstat) with attribute (follow) set to false value" if not $self->follow;
+ foreach my $attr (qw{ dev ino mode nlink uid gid rdev size blksize blocks }) {
+ my $writer = "_set_$attr";
+ $self->$writer( $stat{$attr} );
+ };
+ foreach my $attr (qw{ atime mtime ctime }) {
+ my $writer = "_set_${attr}_epoch";
+ $self->$writer( $stat{$attr} );
+ };
+ }
+ else {
+ @{$self}{ qw{ dev ino mode nlink uid gid rdev size _atime_epoch _mtime_epoch _ctime_epoch blksize blocks } }
+ = map { defined $_ && $_ eq '' ? undef : $_ }
+ CORE::lstat $file or Exception::IO->throw( message => 'Cannot stat' );
+ };
+ };
- return $self->stat;
+ return $self;
};
# Array dereference
sub _deref_array {
my ($self) = @_;
- return [ @{$self}{ qw{ dev ino mode nlink uid gid rdev size _atime_epoch _mtime_epoch _ctime_epoch blksize blocks } } ];
+
+ my @stat;
+ if ($self->strict_accessors) {
+ foreach my $attr (qw{ dev ino mode nlink uid gid rdev size blksize blocks }) {
+ my $reader = $attr;
+ push @stat, $self->$reader;
+ };
+ foreach my $attr (qw{ atime mtime ctime }) {
+ my $reader = "_get_${attr}_epoch";
+ push @stat, $self->$reader;
+ };
+ }
+ else {
+ @stat = @{$self}{ qw{ dev ino mode nlink uid gid rdev size _atime_epoch _mtime_epoch _ctime_epoch blksize blocks } }
+ };
+
+ return \@stat;
};
@@ -236,8 +302,9 @@
[ File::Stat::Moose
----------------------------------------------------------------------------------------
+file : Str|FileHandle|CacheFileHandle|OpenHandle {ro, required}
- +follow : Bool {ro}
- +sloppy : Bool {ro}
+ +follow : Bool = false {ro}
+ +sloppy : Bool = false {ro}
+ +strict_accessors : Bool = false {rw}
+dev : Maybe[Int] {ro}
+ino : Maybe[Int] {ro}
+mode : Maybe[Int] {ro}
@@ -255,9 +322,7 @@
#_mtime_epoch : Maybe[Int] {ro}
#_ctime_epoch : Maybe[Int] {ro}
----------------------------------------------------------------------------------------
- +update() : Self
+stat() : Self
- <<deprecated>> +lstat() : Self
<<utility>> +stat( file : Str|FileHandle|CacheFileHandle|OpenHandle = $_ ) : Self|Array
<<utility>> +lstat( file : Str|FileHandle|CacheFileHandle|OpenHandle = $_ ) : Self|Array
-_deref_array() : ArrayRef {overload="@{}"}
@@ -289,15 +354,25 @@
=back
+=head1 INHERITANCE
+
+=over 2
+
+=item *
+
+extends L<Moose::Object>
+
+=back
+
=head1 EXCEPTIONS
=over
-=item Exception::Argument
+=item L<Exception::Argument>
Thrown whether a methods is called with wrong arguments.
-=item Exception::IO
+=item L<Exception::IO>
Thrown whether an IO error is occurred.
@@ -312,18 +387,23 @@
Contains the file for check. The attribute can hold file name or file
handler or IO object.
-=item follow : Bool {ro}
+=item follow : Bool = false {ro}
If the value is true and the I<file> for check is symlink, then follows it
than checking the symlink itself.
-=item sloppy : Bool {ro}
+=item sloppy : Bool = false {ro}
On Win32 L<perlfunc/stat> needs to open the file to determine the link count
and update attributes that may have been changed through hard links. If the
I<sloppy> is set to true value, L<perlfunc/stat> speeds up by not performing
this operation.
+=item strict_accessors : Bool = false {rw}
+
+By default the accessors might be avoided for performance reason. This
+optimalization can be disabled if the attribute is set to true value.
+
=item dev : Maybe[Int] {ro}
ID of device containing file. If this value and following has no meaning on
@@ -478,9 +558,10 @@
=head1 PERFORMANCE
-The L<File::Stat::Moose> module is 1.7 times slower than L<File::stat>
-module and 10 times slower than L<perlfunc/stat> function. The function
-interface is 1.5 times slower than OO interface.
+The L<File::Stat::Moose> module is 4 times slower than L<File::stat>
+module and 30 times slower than L<perlfunc/stat> function. The function
+interface is 1.5 times slower than OO interface. The strict accessors are
+2.5 times slower that optimized direct access to hash.
=head1 SEE ALSO
Modified: File-Stat-Moose/trunk/lib/MooseX/Types/CacheFileHandle.pm
===================================================================
--- File-Stat-Moose/trunk/lib/MooseX/Types/CacheFileHandle.pm 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/lib/MooseX/Types/CacheFileHandle.pm 2009-01-29 16:57:42 UTC (rev 7413)
@@ -28,7 +28,7 @@
use strict;
use warnings;
-our $VERSION = '0.0501';
+our $VERSION = '0.06';
use Moose::Util::TypeConstraints;
Modified: File-Stat-Moose/trunk/lib/MooseX/Types/OpenHandle.pm
===================================================================
--- File-Stat-Moose/trunk/lib/MooseX/Types/OpenHandle.pm 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/lib/MooseX/Types/OpenHandle.pm 2009-01-29 16:57:42 UTC (rev 7413)
@@ -29,7 +29,7 @@
use strict;
use warnings;
-our $VERSION = '0.0501';
+our $VERSION = '0.06';
use Moose::Util::TypeConstraints;
Modified: File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm
===================================================================
--- File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm 2009-01-29 16:57:42 UTC (rev 7413)
@@ -49,6 +49,22 @@
assert_not_equals(0, $obj->size);
};
+sub test_new_file_strict_accessors {
+ my $obj = File::Stat::Moose->new( file => $file, strict_accessors => 1 );
+ assert_isa('File::Stat::Moose', $obj);
+ {
+ foreach my $attr (qw{ dev ino mode nlink uid gid rdev size blksize blocks }) {
+ assert_matches(qr/^-?\d+$/, $obj->$attr, $attr) if defined $obj->$attr;
+ };
+ };
+ {
+ foreach my $attr (qw { atime mtime ctime }) {
+ assert_isa('DateTime', $obj->$attr, $attr) if defined $obj->$attr;
+ };
+ };
+ assert_not_equals(0, $obj->size);
+};
+
sub test_new_file_sloppy {
my $obj = File::Stat::Moose->new( file => $file, sloppy => TRUE );
assert_isa('File::Stat::Moose', $obj);
@@ -89,6 +105,30 @@
assert_not_equals($obj1->ino, $obj2->ino);
};
+sub test_new_symlink_strict_accessors {
+ return unless $symlink;
+
+ my $obj1 = File::Stat::Moose->new( file => $symlink, strict_accessors => 1 );
+ assert_isa('File::Stat::Moose', $obj1);
+ {
+ foreach my $attr (qw{ dev ino mode nlink uid gid rdev size blksize blocks }) {
+ assert_matches(qr/^-?\d+$/, $obj1->$attr, $attr) if defined $obj1->$attr;
+ };
+ };
+ {
+ foreach my $attr (qw { atime mtime ctime }) {
+ assert_isa('DateTime', $obj1->$attr, $attr) if defined $obj1->$attr;
+ };
+ };
+ assert_not_equals(0, $obj1->size);
+
+ my $obj2 = File::Stat::Moose->new( file => $symlink, follow => 1, strict_accessors => 1 );
+ assert_isa('File::Stat::Moose', $obj2);
+ assert_not_equals(0, $obj2->size);
+
+ assert_not_equals($obj1->ino, $obj2->ino);
+};
+
sub test_new_error_args {
assert_raises( qr/is required/, sub {
my $obj = File::Stat::Moose->new;
@@ -129,6 +169,18 @@
assert_not_equals(0, $obj->[7]);
};
+sub test__deref_array_strict_accessors {
+ my $obj = File::Stat::Moose->new( file => $file, strict_accessors => 1 );
+ assert_isa('File::Stat::Moose', $obj);
+ assert_equals(13, scalar @$obj);
+ {
+ foreach my $i (0..12) {
+ assert_matches(qr/^\d+$/, $obj->[$i], $i) if defined $obj->[$i];
+ };
+ };
+ assert_not_equals(0, $obj->[7]);
+};
+
sub test_stat {
my $file = File::Temp->new;
assert_isa('File::Temp', $file);
Modified: File-Stat-Moose/trunk/xt/benchmark.pl
===================================================================
--- File-Stat-Moose/trunk/xt/benchmark.pl 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/xt/benchmark.pl 2009-01-29 16:57:42 UTC (rev 7413)
@@ -2,50 +2,52 @@
use lib 'lib', '../lib';
-package My::CoreStat;
-our $n = 0;
-sub test {
- my $size = (stat '/etc/passwd')[7];
- $n++;
-}
-package My::FileStat;
-use File::stat;
-our $n = 0;
-sub test {
- my $st = stat '/etc/passwd';
- my $size = $st->size;
- $n++;
-}
-package My::FileStatMoose;
-use File::Stat::Moose;
-our $n = 0;
-sub test {
- my $size = File::Stat::Moose->new(file=>'/etc/passwd')->size;
- $n++;
-}
-package My::FileStatMooseFunc;
-use File::Stat::Moose 'stat';
-our $n = 0;
-sub test {
- my $size = (stat '/etc/passwd')[7];
- $n++;
-}
-
package main;
use Benchmark ':all';
my $result = timethese($ARGV[0] || -1, {
- '1_CoreStat' => sub { My::CoreStat::test; },
- '2_FileStat' => sub { My::FileStat::test; },
- '3_FileStatMoose' => sub { My::FileStatMoose::test; },
- '4_FileStatMooseFunc' => sub { My::FileStatMooseFunc::test; },
+ '1_CoreStat' => sub {
+
+ package My::CoreStat;
+ my $size = (stat $0)[7];
+
+ },
+ '2_FileStat' => sub {
+
+ package My::FileStat;
+ use File::stat 'stat';
+ my $st = stat $0;
+ my $size = $st->size;
+
+ },
+ '3_FileStatMoose' => sub {
+
+ package My::FileStatMoose;
+ use File::Stat::Moose ();
+ my $size = File::Stat::Moose->new( file => $0 )->size;
+
+ },
+ '4_FileStatMooseFunc' => sub {
+
+ package My::FileStatMooseFunc;
+ use File::Stat::Moose 'stat';
+ my $size = (stat $0)[7];
+
+ },
+ '4_FileStatMooseFuncStrictAccessors' => sub {
+
+ package My::FileStatMooseStrictAccessors;
+ use File::Stat::Moose ();
+ my $size = File::Stat::Moose->new( file => $0, strict_accessors => 1 )->size;
+
+ },
});
cmpthese($result);
Copied: File-Stat-Moose/trunk/xt/cover.pl (from rev 7411, File-Stat-Moose/trunk/xt/cover.sh)
===================================================================
--- File-Stat-Moose/trunk/xt/cover.pl (rev 0)
+++ File-Stat-Moose/trunk/xt/cover.pl 2009-01-29 16:57:42 UTC (rev 7413)
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+use 5.008;
+use strict;
+no warnings;
+
+use File::Basename;
+use File::Spec;
+use Cwd;
+
+BEGIN {
+ chdir dirname(__FILE__) or die "$!";
+ chdir '..' or die "$!";
+};
+
+do "./Build.PL";
+
+local @ARGV = (@ARGV, 'testcover');
+do "./Build";
Property changes on: File-Stat-Moose/trunk/xt/cover.pl
___________________________________________________________________
Name: svn:executable
+ *
Deleted: File-Stat-Moose/trunk/xt/cover.sh
===================================================================
--- File-Stat-Moose/trunk/xt/cover.sh 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/xt/cover.sh 2009-01-29 16:57:42 UTC (rev 7413)
@@ -1,7 +0,0 @@
-#!/bin/sh
-cd $(dirname $0)
-cd ..
-perl Build.PL
-cover -delete
-HARNESS_PERL_SWITCHES=-MDevel::Cover ./Build test
-cover
Modified: File-Stat-Moose/trunk/xt/profile.pl
===================================================================
--- File-Stat-Moose/trunk/xt/profile.pl 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/xt/profile.pl 2009-01-29 16:57:42 UTC (rev 7413)
@@ -5,7 +5,7 @@
use File::Stat::Moose;
foreach (1..10000) {
- my $size = File::Stat::Moose->new(file=>'/etc/passwd')->size;
+ my $size = File::Stat::Moose->new( file => $0, @ARGV )->size;
};
print "tmon.out data collected. Call dprofpp\n";
Modified: File-Stat-Moose/trunk/xt/trace.pl
===================================================================
--- File-Stat-Moose/trunk/xt/trace.pl 2009-01-29 16:34:35 UTC (rev 7412)
+++ File-Stat-Moose/trunk/xt/trace.pl 2009-01-29 16:57:42 UTC (rev 7413)
@@ -5,5 +5,5 @@
use File::Stat::Moose;
foreach (1..10) {
- my $size = File::Stat::Moose->new(file=>'/etc/passwd')->size;
+ my $size = File::Stat::Moose->new( file => $0, @ARGV )->size;
};
More information about the Moose-commits
mailing list