1 #!/usr/local/bin/perl -w
7 use POSIX qw( :fcntl_h ) ;
8 use Test::More tests => 1 ;
10 # in case SEEK_SET isn't defined in older perls. it seems to always be 0
14 *SEEK_SET = sub { 0 } unless defined \&SEEK_SET ;
21 skip <<TEXT, 1 if $@ ;
22 B.pm not found in this Perl. This will cause slurping of
23 the DATA handle to fail.
26 test_data_list_slurp() ;
32 sub test_data_list_slurp {
34 my $data_seek = tell( \*DATA );
36 # first slurp in the lines
38 my @slurp_lines = read_file( \*DATA ) ;
40 # now seek back and read all the lines with the <> op and we make
43 seek( \*DATA, $data_seek, SEEK_SET ) || die "seek $!" ;
44 my @data_lines = <DATA> ;
46 # test the array slurp
48 ok( eq_array( \@data_lines, \@slurp_lines ), 'list slurp of DATA' ) ;
59 we can't test long handle slurps from DATA since i would have to type