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. Note this will cause slurping of
23 the DATA handle to fail.
26 test_data_scalar_slurp() ;
35 sub test_data_scalar_slurp {
37 my $data_seek = tell( \*DATA );
39 # first slurp in the text
41 my $slurp_text = read_file( \*DATA ) ;
43 # now we need to get the golden data
45 seek( \*DATA, $data_seek, SEEK_SET ) || die "seek $!" ;
46 my $data_text = join( '', <DATA> ) ;
48 is( $slurp_text, $data_text, 'scalar slurp of DATA' ) ;
59 we can't test long handle slurps from DATA since i would have to type