Actually, in this case it must be:
use 5.006;
require is a runtime statement, but if we're using 5.6.0 syntax we need the version check at compile time. Compare these two examples, one with require and one with use, and their results with perl5.005_03:
#!perl
require 5.006;
use strict;
our $var = 7;
__END__
Global symbol "$var" requires explicit package name at tmp.pl line 4.
Execution of tmp.pl aborted due to compilation errors.
#!perl
use 5.006;
use strict;
our $var = 7;
__END__
Perl 5.006 required--this is only version 5.00503, stopped at tmp2.pl
+line 1.
BEGIN failed--compilation aborted at tmp2.pl line 1.
I believe I was correct when I said 'non-backward compatible'; I was referring to the use of version strings with require/use, as in require 5.6.0;. That feature is forward compatible (future versions of perl5 will support version strings) but not backwards compatible (past versions of perl do not support version strings). |