- or download this
push @{ ['anonymous','array'] }, 'variable';
- or download this
my $aRef= [ 'anonymous', 'array' ];
print "@$aRef\n";
push @$aRef, 'variable';
print "@$aRef\n";
- or download this
my $x= 3; my $y= '3.0';
print '$x and $y have the same value'
if $x == $y; # read "if" as "because"
- or download this
my $x= 3;
my $y= "3";
print '$x and $y have the same value'
if $x eq $y;
- or download this
my $x= 3;
my $y= pack "j", 3;
- or download this
my $x= 3;
my $y= 3;
my $z= "$y";
- or download this
use vars qw< $x >;
my $y;
*x= \$y;
- or download this
use vars qw< $x >;
{
...
}
}
print $x;
- or download this
sub blog {
my( $x )= @_;
...
$x = 1
$x = 0
$x still 1
- or download this
use vars qw< $x >;
$x= 'glo';
...
print $$y; # 'glo'
print eval '$'.$y; # 'lex'
}