From e3feaad6c02ef0020729dcdb44874f3068d78490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Niezna=C5=84ski?= Date: Sun, 29 Jan 2017 21:55:42 +0100 Subject: [PATCH] Remove use of indirect object notation --- autogen/compilers/compile.pl | 14 +++++++------- autogen/complex/footer.pl | 16 ++++++++-------- autogen/doc/Pod/Tree/MyHTML.pm | 8 ++++---- autogen/doc/clone.pl | 6 +++--- autogen/doc/compound.pl | 2 +- autogen/doc/compound_alignment.pl | 2 +- autogen/doc/configure.pl | 6 +++--- autogen/doc/enum.pl | 2 +- autogen/doc/enum_names.pl | 2 +- autogen/doc/hooks3.pl | 2 +- autogen/doc/intro.pl | 6 +++--- autogen/doc/keywords.pl | 2 +- autogen/doc/parse_file.pl | 2 +- autogen/doc/pdf/Pod/MyLaTeX.pm | 6 +++--- autogen/doc/pdf/Pod/ParseUtils.pm | 2 +- autogen/doc/preprocessor.pl | 2 +- autogen/doc/reconfig.pl | 2 +- autogen/doc/sourcify.pl | 2 +- autogen/doc/synopsis_advanced.pl | 2 +- autogen/doc/types.pl | 2 +- autogen/ppsym/ppsym.pl | 2 +- autogen/sizes/mkoffsets.pl | 2 +- autogen/sizes/mksizes.pl | 2 +- devel/bench.pl | 2 +- devel/test.pl | 10 +++++----- devel/test2.pl | 12 ++++++------ devel/test3.pl | 2 +- devel/test5.pl | 2 +- devel/testdrive.pl | 8 ++++---- lib/Convert/Binary/C.pm | 26 +++++++++++++------------- lib/Convert/Binary/C/Cached.pm | 4 ++-- support/Test/Harness.pm | 4 ++-- support/Test/Harness/Point.pm | 2 +- support/Test/More.pm | 2 +- token/pragma.pl | 4 ++-- util/t/maketests.pl | 2 +- util/t/test_memalloc.pl | 2 +- 37 files changed, 88 insertions(+), 88 deletions(-) diff --git a/autogen/compilers/compile.pl b/autogen/compilers/compile.pl index 35549e5..03a9f03 100755 --- a/autogen/compilers/compile.pl +++ b/autogen/compilers/compile.pl @@ -64,7 +64,7 @@ do $OPT{cfgfile}; -my $c = new Convert::Binary::C %config; +my $c = Convert::Binary::C->new(%config); $c->parse_file('test.h'); @@ -86,7 +86,7 @@ "$1$suf"; /ge; -my $cc = new Compiler::Config %OPT, ccflags => [@ARGV]; +my $cc = Compiler::Config->new(%OPT, ccflags => [@ARGV]); # my $cfg = $cc->get_config; my $bin = $cc->_test_type($c->sourcify, 'test', $init, $c->sizeof('test')); @@ -411,7 +411,7 @@ sub check_config $self->{debug} and import Convert::Binary::C debug => 'all'; - my $c = eval { new Convert::Binary::C }; + my $c = eval { Convert::Binary::C->new }; $@ and return {code => ERR_CREATE}; eval { $c->configure( %$config ) }; @@ -888,7 +888,7 @@ sub _test_type my $res = $self->_compile_temp; $res->{status} and return undef; - my $fh = new IO::File $self->{obj} or return undef; + my $fh = IO::File->new($self->{obj}) or return undef; binmode $fh; my $obj = do { local $/; <$fh> }; @@ -1977,7 +1977,7 @@ sub _names $files{$file} = 1; $ff = keys %files; $self->_work_in_progress( "$ff files found" ); - my $fh = new IO::File $file; + my $fh = IO::File->new($file); next unless defined $fh; while( <$fh> ) { if( /^\s*#\s*include\s*[<"]([^>"]+)[>"]/ ) { @@ -1999,7 +1999,7 @@ sub _names $fs++; $self->_work_in_progress( "($count) $fs/$ff files scanned" ); -e $name or next; - my $fh = new IO::File $name; + my $fh = IO::File->new($name); next unless defined $fh; my $file = do { local $/; <$fh> }; $file =~ s{\\\s*$/}{}g; @@ -2240,7 +2240,7 @@ sub _temp unlink $self->{temp} or croak "Could not remove temporary file '$self->{temp}': $!\n"; } - my $f = new IO::File ">$self->{temp}"; + my $f = IO::File->new(">$self->{temp}"); defined $f or croak "Could not open temporary file '$self->{temp}': $!\n"; $f->print( @_ ); diff --git a/autogen/complex/footer.pl b/autogen/complex/footer.pl index 8eae455..c34bcb0 100644 --- a/autogen/complex/footer.pl +++ b/autogen/complex/footer.pl @@ -152,14 +152,14 @@ sub checkrc } } -my $p = new Convert::Binary::C ByteOrder => 'LittleEndian', - ShortSize => 2, - IntSize => 4, - LongSize => 4, - PointerSize => 4, - FloatSize => 4, - DoubleSize => 8, - Alignment => 4; +my $p = Convert::Binary::C->new(ByteOrder => 'LittleEndian', + ShortSize => 2, + IntSize => 4, + LongSize => 4, + PointerSize => 4, + FloatSize => 4, + DoubleSize => 8, + Alignment => 4); $p->parse($types); diff --git a/autogen/doc/Pod/Tree/MyHTML.pm b/autogen/doc/Pod/Tree/MyHTML.pm index f657b4e..4c444f0 100644 --- a/autogen/doc/Pod/Tree/MyHTML.pm +++ b/autogen/doc/Pod/Tree/MyHTML.pm @@ -61,7 +61,7 @@ sub _resolve_source isa $source, 'Pod::Tree' and return $source; - my $tree = new Pod::Tree; + my $tree = Pod::Tree->new; not $ref and $tree->load_file ( $source); isa $source, 'IO::File' and $tree->load_fh ( $source); $ref eq 'SCALAR' and $tree->load_string ($$source); @@ -80,11 +80,11 @@ sub _resolve_dest local *isa = \&UNIVERSAL::isa; isa $dest, 'HTML::Stream' and return $dest; - ref $dest and return new HTML::Stream $dest; + ref $dest and return HTML::Stream->new($dest); - my $fh = new IO::File; + my $fh = IO::File->new; $fh->open(">$dest") or die "Pod::Tree::MyHTML::new: Can't open $dest: $!\n"; - new HTML::Stream $fh + HTML::Stream->new($fh) } diff --git a/autogen/doc/clone.pl b/autogen/doc/clone.pl index 732e835..736d52c 100644 --- a/autogen/doc/clone.pl +++ b/autogen/doc/clone.pl @@ -2,14 +2,14 @@ #-8<- -$c = new Convert::Binary::C Include => ['/usr/include']; +$c = Convert::Binary::C->new(Include => ['/usr/include']); $c->parse_file('definitions.c'); $clone = $c->clone; #-8<- -$c = new Convert::Binary::C Include => ['/usr/include']; +$c = Convert::Binary::C->new(Include => ['/usr/include']); $c->parse_file('definitions.c'); -$clone = new Convert::Binary::C %{$c->configure}; +$clone = Convert::Binary::C->new(%{$c->configure}); $clone->parse($c->sourcify); diff --git a/autogen/doc/compound.pl b/autogen/doc/compound.pl index ab5b004..4e05c67 100644 --- a/autogen/doc/compound.pl +++ b/autogen/doc/compound.pl @@ -2,7 +2,7 @@ use Data::Dumper; $Data::Dumper::Indent = 1; -$c = new Convert::Binary::C; +$c = Convert::Binary::C->new; $c->parse_file('definitions.c'); #-8<- diff --git a/autogen/doc/compound_alignment.pl b/autogen/doc/compound_alignment.pl index d0a993e..713dd60 100644 --- a/autogen/doc/compound_alignment.pl +++ b/autogen/doc/compound_alignment.pl @@ -2,7 +2,7 @@ use Data::Dumper; $Data::Dumper::Indent = 0; -$c = new Convert::Binary::C Alignment => 4, CompoundAlignment => 4; +$c = Convert::Binary::C->new(Alignment => 4, CompoundAlignment => 4); #-8<- diff --git a/autogen/doc/configure.pl b/autogen/doc/configure.pl index 5af5f32..de9fd20 100644 --- a/autogen/doc/configure.pl +++ b/autogen/doc/configure.pl @@ -3,8 +3,8 @@ use vars qw( $order ); #-8<- $Data::Dumper::Indent = 1; #-8<- -$c = new Convert::Binary::C Define => ['DEBUGGING', 'FOO=123'], - Include => ['/usr/include']; +$c = Convert::Binary::C->new(Define => ['DEBUGGING', 'FOO=123'], + Include => ['/usr/include']); print Dumper($c->configure); @@ -29,7 +29,7 @@ #-8<- 6 -$c = new Convert::Binary::C Include => ['/include']; +$c = Convert::Binary::C->new(Include => ['/include']); $c->Include('/usr/include', '/usr/local/include'); print Dumper($c->Include); diff --git a/autogen/doc/enum.pl b/autogen/doc/enum.pl index 46ecf66..9ee2d68 100644 --- a/autogen/doc/enum.pl +++ b/autogen/doc/enum.pl @@ -2,7 +2,7 @@ use Data::Dumper; $Data::Dumper::Indent = 1; -$c = new Convert::Binary::C; +$c = Convert::Binary::C->new; $c->parse_file('definitions.c'); #-8<- diff --git a/autogen/doc/enum_names.pl b/autogen/doc/enum_names.pl index a58fccf..3f55144 100644 --- a/autogen/doc/enum_names.pl +++ b/autogen/doc/enum_names.pl @@ -2,7 +2,7 @@ use Data::Dumper; $Data::Dumper::Indent = 0; -$c = new Convert::Binary::C; +$c = Convert::Binary::C->new; #-8<- diff --git a/autogen/doc/hooks3.pl b/autogen/doc/hooks3.pl index 6dd1b16..d28b6c1 100644 --- a/autogen/doc/hooks3.pl +++ b/autogen/doc/hooks3.pl @@ -218,7 +218,7 @@ use Config; -$c = new Convert::Binary::C %CC, OrderMembers => 1; +$c = Convert::Binary::C->new(%CC, OrderMembers => 1); $c->Include(["$Config{archlib}/CORE", @{$c->Include}]); $c->parse(<new; #-8<- @@ -15,8 +15,8 @@ #-8<- -$c = new Convert::Binary::C ByteOrder => 'LittleEndian', - Alignment => 2; +$c = Convert::Binary::C->new(ByteOrder => 'LittleEndian', + Alignment => 2); #-8<- diff --git a/autogen/doc/keywords.pl b/autogen/doc/keywords.pl index 8826a0a..d92e656 100644 --- a/autogen/doc/keywords.pl +++ b/autogen/doc/keywords.pl @@ -11,7 +11,7 @@ close FILE; -my $c = new Convert::Binary::C; +my $c = Convert::Binary::C->new; my @kw; for my $k (sort keys %h) { diff --git a/autogen/doc/parse_file.pl b/autogen/doc/parse_file.pl index d6e048e..f43f5cb 100644 --- a/autogen/doc/parse_file.pl +++ b/autogen/doc/parse_file.pl @@ -1,6 +1,6 @@ use Convert::Binary::C; -$c = new Convert::Binary::C; +$c = Convert::Binary::C->new; #-8<- $c->parse(<<'#-8<-'); diff --git a/autogen/doc/pdf/Pod/MyLaTeX.pm b/autogen/doc/pdf/Pod/MyLaTeX.pm index bb4823b..aec32b0 100644 --- a/autogen/doc/pdf/Pod/MyLaTeX.pm +++ b/autogen/doc/pdf/Pod/MyLaTeX.pm @@ -1117,7 +1117,7 @@ sub interior_sequence { } elsif ($seq_command eq 'L') { - my $link = new Pod::Hyperlink($seq_argument); + my $link = Pod::Hyperlink->new($seq_argument); # undef on failure unless (defined $link) { @@ -1161,7 +1161,7 @@ sub interior_sequence { } elsif ($seq_command eq 'P') { print "[$seq_argument]\n"; if( exists $self->{KnownPODs}{$seq_argument} ) { - my $link = new Pod::Hyperlink($seq_argument); + my $link = Pod::Hyperlink->new($seq_argument); # undef on failure unless (defined $link) { @@ -1232,7 +1232,7 @@ sub begin_list { # Indicate that a list should be started for the next item # need to do this to work out the type of list - push ( @{$self->lists}, new Pod::List(-indent => $indent, + push ( @{$self->lists}, Pod::List->new(-indent => $indent, -start => $line_num, -file => $self->input_file, ) diff --git a/autogen/doc/pdf/Pod/ParseUtils.pm b/autogen/doc/pdf/Pod/ParseUtils.pm index 3f57bda..c0c3dd7 100644 --- a/autogen/doc/pdf/Pod/ParseUtils.pm +++ b/autogen/doc/pdf/Pod/ParseUtils.pm @@ -21,7 +21,7 @@ Pod::ParseUtils - helpers for POD parsing and conversion use Pod::ParseUtils; - my $list = new Pod::List; + my $list = Pod::List->new; my $link = Pod::Hyperlink->new('Pod::Parser'); =head1 DESCRIPTION diff --git a/autogen/doc/preprocessor.pl b/autogen/doc/preprocessor.pl index abcef3e..8142ddd 100644 --- a/autogen/doc/preprocessor.pl +++ b/autogen/doc/preprocessor.pl @@ -1,5 +1,5 @@ use Convert::Binary::C; -$c = new Convert::Binary::C Alignment => 4; +$c = Convert::Binary::C->new(Alignment => 4); #-8<- diff --git a/autogen/doc/reconfig.pl b/autogen/doc/reconfig.pl index c7f1715..7e90a8f 100644 --- a/autogen/doc/reconfig.pl +++ b/autogen/doc/reconfig.pl @@ -1,6 +1,6 @@ use Convert::Binary::C; -$c = new Convert::Binary::C Alignment => 4, IntSize => 4; +$c = Convert::Binary::C->new(Alignment => 4, IntSize => 4); #-8<- $c->parse(<<'#-8<-'); diff --git a/autogen/doc/sourcify.pl b/autogen/doc/sourcify.pl index d8146f8..9443fee 100644 --- a/autogen/doc/sourcify.pl +++ b/autogen/doc/sourcify.pl @@ -1,6 +1,6 @@ use Convert::Binary::C; -$c = new Convert::Binary::C; +$c = Convert::Binary::C->new; $c->parse(<<'END'); #define ADD(a, b) ((a) + (b)) diff --git a/autogen/doc/synopsis_advanced.pl b/autogen/doc/synopsis_advanced.pl index e312a7c..05a38b8 100644 --- a/autogen/doc/synopsis_advanced.pl +++ b/autogen/doc/synopsis_advanced.pl @@ -4,7 +4,7 @@ #--------------------- # Create a new object #--------------------- -my $c = new Convert::Binary::C ByteOrder => 'BigEndian'; +my $c = Convert::Binary::C->new(ByteOrder => 'BigEndian'); #--------------------------------------------------- # Add include paths and global preprocessor defines diff --git a/autogen/doc/types.pl b/autogen/doc/types.pl index 6411e0d..0051ac6 100644 --- a/autogen/doc/types.pl +++ b/autogen/doc/types.pl @@ -7,7 +7,7 @@ typedef int foo; #-8<- -$c = new Convert::Binary::C; +$c = Convert::Binary::C->new; $size = $c->sizeof('unsigned long'); $data = $c->pack('short int', 42); diff --git a/autogen/ppsym/ppsym.pl b/autogen/ppsym/ppsym.pl index e14ac02..a39460f 100755 --- a/autogen/ppsym/ppsym.pl +++ b/autogen/ppsym/ppsym.pl @@ -71,7 +71,7 @@ END sub getsym { /\.h$/ or return; - my $fh = new IO::File $_ or return; + my $fh = IO::File->new($_) or return; my $file = do { local $/; <$fh> }; my $id = '[a-zA-Z_]\w*'; diff --git a/autogen/sizes/mkoffsets.pl b/autogen/sizes/mkoffsets.pl index a378cf5..46305ab 100644 --- a/autogen/sizes/mkoffsets.pl +++ b/autogen/sizes/mkoffsets.pl @@ -5,7 +5,7 @@ my $cfg = require '../../tests/include/config.pl'; s!^tests!../../tests! for @{$cfg->{Include}}; -my $c = new Convert::Binary::C %$cfg; +my $c = Convert::Binary::C->new(%$cfg); $c->parse_file( '../../tests/include/include.c' ); diff --git a/autogen/sizes/mksizes.pl b/autogen/sizes/mksizes.pl index 80b08bf..cf397e3 100644 --- a/autogen/sizes/mksizes.pl +++ b/autogen/sizes/mksizes.pl @@ -5,7 +5,7 @@ my $cfg = require '../../tests/include/config.pl'; s!^tests!../../tests! for @{$cfg->{Include}}; -my $c = new Convert::Binary::C %$cfg; +my $c = Convert::Binary::C->new(%$cfg); $c->parse_file( '../../tests/include/include.c' ); diff --git a/devel/bench.pl b/devel/bench.pl index 6a9b10f..3f55323 100644 --- a/devel/bench.pl +++ b/devel/bench.pl @@ -44,7 +44,7 @@ Include => ['tests/include/perlinc', 'tests/include/include'], ); -my $c = new Convert::Binary::C; +my $c = Convert::Binary::C->new; for my $k (keys %config) { eval { $c->configure($k => $config{$k}) }; diff --git a/devel/test.pl b/devel/test.pl index d3e49e9..240730f 100644 --- a/devel/test.pl +++ b/devel/test.pl @@ -6,11 +6,11 @@ my $code = do { local $/; }; -my $p = new Convert::Binary::C ByteOrder => 'BigEndian', - IntSize => 4, - PointerSize => 4, - EnumSize => 0, - Alignment => 4; +my $p = Convert::Binary::C->new(ByteOrder => 'BigEndian', + IntSize => 4, + PointerSize => 4, + EnumSize => 0, + Alignment => 4); $p->parse( $code ); diff --git a/devel/test2.pl b/devel/test2.pl index fcfc4cc..a9f476e 100644 --- a/devel/test2.pl +++ b/devel/test2.pl @@ -6,12 +6,12 @@ my $code = do { local $/; }; -my $p = new Convert::Binary::C ByteOrder => 'BigEndian', - IntSize => 4, - PointerSize => 4, - EnumSize => 0, - Warnings => 1, - Alignment => 4; +my $p = Convert::Binary::C->new(ByteOrder => 'BigEndian', + IntSize => 4, + PointerSize => 4, + EnumSize => 0, + Warnings => 1, + Alignment => 4); $p->parse( $code ); diff --git a/devel/test3.pl b/devel/test3.pl index e204951..a6ca735 100644 --- a/devel/test3.pl +++ b/devel/test3.pl @@ -8,7 +8,7 @@ /usr/include ); -my $p = new Convert::Binary::C Include => [@inc]; +my $p = Convert::Binary::C->new(Include => [@inc]); $p->parse( <<'ENDC' ); #include diff --git a/devel/test5.pl b/devel/test5.pl index c77e2b5..d963520 100644 --- a/devel/test5.pl +++ b/devel/test5.pl @@ -6,7 +6,7 @@ my $code = do { local $/; }; -my $p = new Convert::Binary::C; +my $p = Convert::Binary::C->new; $p->parse( $code ); print Data::Dumper->Dump( [[$p->enum],[$p->struct],[$p->typedef]], diff --git a/devel/testdrive.pl b/devel/testdrive.pl index b897dee..cdef229 100755 --- a/devel/testdrive.pl +++ b/devel/testdrive.pl @@ -85,10 +85,10 @@ $OPT{remove} and remove_reports( $hosts[0] ); if ($OPT{compile}) { - my @t = map { new threads + my @t = map { threads->new( \&test_compile, $_, $file # \&version, $_ - } @hosts; + ) } @hosts; $_->join for @t; } @@ -161,7 +161,7 @@ sub version $perl -V END - my $f = new IO::File; + my $f = IO::File->new; $f->open( ">version-$host->{ip}.log" ); $f->print( @lines ); $f->close; @@ -203,7 +203,7 @@ sub test_compile rm -rf $dist END - my $f = new IO::File; + my $f = IO::File->new; $f->open( ">testdrive-$host->{ip}.log" ); $f->print( @lines ); $f->close; diff --git a/lib/Convert/Binary/C.pm b/lib/Convert/Binary/C.pm index cf0057b..1a8c606 100644 --- a/lib/Convert/Binary/C.pm +++ b/lib/Convert/Binary/C.pm @@ -103,7 +103,7 @@ Convert::Binary::C - Binary Data Conversion using C Types #--------------------- # Create a new object #--------------------- - my $c = new Convert::Binary::C ByteOrder => 'BigEndian'; + my $c = Convert::Binary::C->new(ByteOrder => 'BigEndian'); #--------------------------------------------------- # Add include paths and global preprocessor defines @@ -349,8 +349,8 @@ and alignment, you can use or you can change the construction code to - $c = new Convert::Binary::C ByteOrder => 'LittleEndian', - Alignment => 2; + $c = Convert::Binary::C->new(ByteOrder => 'LittleEndian', + Alignment => 2); Either way, the object will now know that it should use little endian (Intel) byte order and 2-byte struct member @@ -606,7 +606,7 @@ Basic types, or atomic types, are C or C, for example. It's possible to use these basic types without having parsed any code. You can simply do - $c = new Convert::Binary::C; + $c = Convert::Binary::C->new; $size = $c->sizeof('unsigned long'); $data = $c->pack('short int', 42); @@ -1450,7 +1450,7 @@ the perl internals using hooks. use Config; - $c = new Convert::Binary::C %CC, OrderMembers => 1; + $c = Convert::Binary::C->new(%CC, OrderMembers => 1); $c->Include(["$Config{archlib}/CORE", @{$c->Include}]); $c->parse(<new; without additional arguments to create an object, or you can optionally pass any arguments to the constructor that are @@ -1649,8 +1649,8 @@ used with the L module, for example: use Convert::Binary::C; use Data::Dumper; - $c = new Convert::Binary::C Define => ['DEBUGGING', 'FOO=123'], - Include => ['/usr/include']; + $c = Convert::Binary::C->new(Define => ['DEBUGGING', 'FOO=123'], + Include => ['/usr/include']); print Dumper($c->configure); @@ -1719,7 +1719,7 @@ But if you pass a list of strings instead of an array reference (which cannot be done when using L|/"configure">), the new list items are B to the current list, so - $c = new Convert::Binary::C Include => ['/include']; + $c = Convert::Binary::C->new(Include => ['/include']); $c->Include('/usr/include', '/usr/local/include'); print Dumper($c->Include); @@ -2616,7 +2616,7 @@ The L|/"clean"> method returns a reference to its object. Makes the object return an exact independent copy of itself. - $c = new Convert::Binary::C Include => ['/usr/include']; + $c = Convert::Binary::C->new(Include => ['/usr/include']); $c->parse_file('definitions.c'); $clone = $c->clone; @@ -2626,9 +2626,9 @@ the order of the parsed data, which would make methods such as L|/"compound"> return the definitions in a different order.) to: - $c = new Convert::Binary::C Include => ['/usr/include']; + $c = Convert::Binary::C->new(Include => ['/usr/include']); $c->parse_file('definitions.c'); - $clone = new Convert::Binary::C %{$c->configure}; + $clone = Convert::Binary::C->new(%{$c->configure}); $clone->parse($c->sourcify); Using L|/"clone"> is just a lot faster. @@ -3945,7 +3945,7 @@ represent all parsed C data structures. use Convert::Binary::C; - $c = new Convert::Binary::C; + $c = Convert::Binary::C->new; $c->parse(<<'END'); #define ADD(a, b) ((a) + (b)) diff --git a/lib/Convert/Binary/C/Cached.pm b/lib/Convert/Binary/C/Cached.pm index 1ea73c5..8245f47 100644 --- a/lib/Convert/Binary/C/Cached.pm +++ b/lib/Convert/Binary/C/Cached.pm @@ -227,7 +227,7 @@ sub __parse sub __can_use_cache { my $self = shift; - my $fh = new IO::File; + my $fh = IO::File->new; unless (-e $self->{cache} and -s _) { $ENV{CBCC_DEBUG} and print STDERR "CBCC: cache file '$self->{cache}' doesn't exist or is empty\n"; @@ -304,7 +304,7 @@ sub __can_use_cache sub __save_cache { my $self = shift; - my $fh = new IO::File; + my $fh = IO::File->new; $fh->open(">$self->{cache}") or croak "Cannot open '$self->{cache}': $!"; diff --git a/support/Test/Harness.pm b/support/Test/Harness.pm index 6e8236d..86ffcf4 100644 --- a/support/Test/Harness.pm +++ b/support/Test/Harness.pm @@ -316,7 +316,7 @@ sub execute_tests { my @dir_files; @dir_files = _globdir $Files_In_Dir if defined $Files_In_Dir; - my $run_start_time = new Benchmark; + my $run_start_time = Benchmark->new; my $width = _leader_width(@tests); foreach my $tfile (@tests) { @@ -483,7 +483,7 @@ sub execute_tests { } } } # foreach test - $tot{bench} = timediff(new Benchmark, $run_start_time); + $tot{bench} = timediff(Benchmark->new, $run_start_time); $Strap->_restore_PERL5LIB; diff --git a/support/Test/Harness/Point.pm b/support/Test/Harness/Point.pm index 49a4821..148a364 100644 --- a/support/Test/Harness/Point.pm +++ b/support/Test/Harness/Point.pm @@ -17,7 +17,7 @@ One Test::Harness::Point object represents a single test point. =head2 new() - my $point = new Test::Harness::Point; + my $point = Test::Harness::Point->new; Create a test point object. diff --git a/support/Test/More.pm b/support/Test/More.pm index 465ccd3..50f13fe 100644 --- a/support/Test/More.pm +++ b/support/Test/More.pm @@ -965,7 +965,7 @@ the easiest way to illustrate: skip "HTML::Lint not installed", 2 if $@; - my $lint = new HTML::Lint; + my $lint = HTML::Lint->new; isa_ok( $lint, "HTML::Lint" ); $lint->parse( $html ); diff --git a/token/pragma.pl b/token/pragma.pl index da611a6..47008fc 100644 --- a/token/pragma.pl +++ b/token/pragma.pl @@ -16,8 +16,8 @@ use Devel::Tokenizer::C; -$t = new Devel::Tokenizer::C TokenFunc => \&tok_code, - TokenEnd => 'PRAGMA_TOKEN_END'; +$t = Devel::Tokenizer::C->new(TokenFunc => \&tok_code, + TokenEnd => 'PRAGMA_TOKEN_END'); $t->add_tokens( qw( pack diff --git a/util/t/maketests.pl b/util/t/maketests.pl index ab6faf4..7ed816b 100644 --- a/util/t/maketests.pl +++ b/util/t/maketests.pl @@ -3,7 +3,7 @@ while () { /\S/ or next; my $file = sprintf "t/%03d.t", ++$i; - my $f = new IO::File ">$file" or die "$file: $!\n"; + my $f = IO::File->new(">$file") or die "$file: $!\n"; print $f <new($_[0]) or die "$_[0]: $!\n"; <$file>; }