Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!perl
- package Example::Constants;
- use Exporter qw( import );
- use Readonly;
- Readonly my $EMPTY_STRING => q{};
- our @EXPORT = qw( $EMPTY_STRING );
- #!perl
- use Example::Constants;
- print $EMPTY_STRING . 'foo' . $EMPTY_STRING;
- Readonly our $EMPTY_STRING => q{}; # 'our' instead of 'my'
- package Example::Constants;
- use strict;
- use warnings;
- use base 'Exporter';
- use Readonly;
- Readonly our $EMPTY_STRING => q{};
- our @EXPORT = qw( $EMPTY_STRING );
- 1;
- #!perl
- package Example::Constants;
- use Exporter qw( import );
- use Readonly;
- use Scalar::Util qw(readonly);
- our $EMPTY_STRING;
- our @EXPORT = qw( $EMPTY_STRING );
- if ( !readonly( $EMPTY_STRING ) ) {
- Readonly $EMPTY_STRING => q{};
- }
- #!perl
- package Example::Constants;
- use Exporter qw( import );
- use Readonly;
- use vars qw( $EMPTY_STRING );
- Readonly $EMPTY_STRING => q{};
- our @EXPORT = qw( $EMPTY_STRING );
- #!perl
- package Example::Constants;
- use Exporter qw( import );
- use Readonly;
- our $EMPTY_STRING;
- *EMPTY_STRING = q{};
- our @EXPORT = qw( $EMPTY_STRING );
Add Comment
Please, Sign In to add comment