From: Vincent Pit Date: Thu, 28 Aug 2008 14:40:10 +0000 (+0200) Subject: Fix DATA filehandle X-Git-Tag: v0.02~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a8e5fe66564dd0cbb6a4e6c06af39b79c4e56878;p=perl%2Fmodules%2Fsubs-auto.git Fix DATA filehandle --- diff --git a/lib/subs/auto.pm b/lib/subs/auto.pm index 0625cc6..9978430 100644 --- a/lib/subs/auto.pm +++ b/lib/subs/auto.pm @@ -88,7 +88,7 @@ my @core = qw/abs accept alarm atan2 bind binmode bless break caller chdir time times truncate uc ucfirst umask undef unlink unpack unshift untie use utime values vec wait waitpid wantarray warn when write/; -push @core,qw/not __LINE__ __FILE__/; +push @core,qw/not __LINE__ __FILE__ DATA/; my %core; @core{@core} = (); diff --git a/t/10-base.t b/t/10-base.t index da778e0..4d5840a 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 65; +use Test::More tests => 66; my %_re = ( bareword => sub { qr/^Bareword\s+['"]?\s*$_[0]\s*['"]?\s+not\s+allowed\s+while\s+["']?\s*strict\s+subs\s*['"]?\s+in\s+use\s+at\s+$_[1]\s+line\s+$_[2]/ }, @@ -252,9 +252,19 @@ print DONGS "hlagh\n"; is($buf, "hlagh\n", 'filehandles should\'t be touched'); close DONGS; +seek DATA, 0, 1; +my @fruits = ; +chomp @fruits; +is_deeply(\@fruits, [ qw/apple pear banana/ ], 'DATA filehandle ok'); + eval { foo 7, 9, { } }; _got_ok('compiling to foo(7,9,{})'); is($foo, 16, 'foo really was executed'); eval { blech }; _got_undefined('blech', __LINE__-1); + +__DATA__ +apple +pear +banana