ff.pl
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:1k
- use strict;
- $::WRITE = 1 if (defined($ARGV[0]) and $ARGV[0] eq '--write');
- $::WARN = 0;
- sub get_test_data
- {
- my $fn = shift;
- local($/);
- undef $/;
- open(GIF, $fn) or die "Cannot open $fn: $!n";
- binmode(GIF);
- my $im = <GIF>;
- close (GIF);
- return defined($im) ? $im : "";
- }
- sub write_file
- {
- my $fn = shift;
- my $im = shift;
-
- local($/);
- undef $/;
- print "writingn";
- open(GIF, '>' . $fn) or die "Cannot open $fn: $!n";
- binmode(GIF);
- print GIF $im;
- close (GIF);
- }
- 1;