| October 27, 2005 | Two or Three Things I Learned ... | Prev Next |
Only became core with Perl 5.6.1
Object-oriented interface is even more recent
Alternative: require install via Makefile.PL
Alternative: include under t/ subdirectory
Least bad alternative: use within SKIP blocks
SKIP: {
eval { require 5.006_001 };
skip "tests require File::Temp, core with 5.6", (43 - 10) if $@;
use warnings;
use_ok( 'File::Temp', qw| tempdir |);
my $tdir = tempdir( CLEANUP => 1);
ok(chdir $tdir, 'changed to temp directory for testing');
...
ok(chdir $cwd, 'changed back to original directory');
}
| Home Last TOC | Copyright © 2005 James E Keenan | Prev Next |