NAME
bare.pm - scalars without sigils
SYNOPSIS
foo=3; bar=4;
foo+bar;
#7
foo=bar=3;
foo=5,foo+bar
#58
# Note that foo and $foo are aliased, eg:
die
unless
foo==
$foo
;
die
unless
bar==
$bar
;
"foo: $foo, bar: $bar"
;
#foo: 3, bar: 3
DESCRIPTION
Everyone knows that Perl looks like line noise. Not anymore! bare.pm lets you access scalar variables without a leading sigil.
BUGS AND LIMITATIONS
Note carefully that these are not lexical variables. You can only have one variable foo
, which is aliased to the package variable $foo. You can, however, localize such a variable like so:
There are various other cases where you will have to use a sigil, eg:
bares are implemented as subs, so sigil-less access is quite a bit slower than "native" scalars that use sigils. For code where performance is important, you'll have to use sigils.
LICENSE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Brian Szymanski