package Fake::Our; ###################################################################### # # Fake::Our - Fake 'our' support for perl 5.00503 # # http://search.cpan.org/dist/Fake-Our/ # # Copyright (c) 2014, 2015, 2017 INABA Hitoshi in a CPAN ###################################################################### $Fake::Our::VERSION = '0.10'; use 5.00503; # use strict; # since import() use $^H local $^W = 1; sub import { # provides Fake::Our environment to both perl 5.00503 and 5.006(or later) if ($^H & 0x00000400) { # is strict qw(vars) enabled? strict::->unimport(qw(vars)); } if ($] < 5.006) { no strict 'refs'; # fake 'our' *{caller() . '::our'} = sub { @_ }; # *{caller() . '::our'} = sub : lvalue { @_ }; # perl 5.00503 can't :lvalue } } 1; __END__ =pod =head1 NAME Fake::Our - Fake 'our' support for perl 5.00503 =head1 SYNOPSIS use Fake::Our; =head1 DESCRIPTION Fake::Our provides fake 'our' support on perl 5.00503. This is a module to help writing portable programs and modules across recent and old versions of Perl. Using this module is deprecated, since it gives your script "no strict qw(vars)". Moreover, this module is incomplete and limited. =head1 AUTHOR INABA Hitoshi Eina@cpan.orgE in a CPAN This project was originated by INABA Hitoshi. =head1 LICENSE AND COPYRIGHT This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =head1 BUGS Fake::Our can't lvalue our, like: our($var) = 'lvalue'; our(@var) = qw(lvalue1 lvalue2 lvalue3); our(%var) = qw(key1 lvalue1 key2 lvalue2 key3 lvalue3); =head1 SEE ALSO =over 4 =item * L - Perl Programming Documentation =item * L - PerlMonks =item * L - PerlMonks =item * L - ONLamp.com =item * L - engelschall.com =item * L - cp5.5.3an.barnyard.co.uk =item * L - CPAN =item * L - CPAN =item * L - CPAN =item * L - The BackPAN =back =cut