- or download this
#!/usr/bin/env perl -l
...
print 'Value: ', defined $x[$i] ? $x[$i] : '<undef>';
}
print 'Elements in @x: ', scalar @x;
- or download this
*** Create @x with no elements ***
Elements in @x: 0
...
Index: 32
Value: <undef>
Elements in @x: 22
- or download this
@hash{'goodbye', 'world'} = ();
- or download this
#!/usr/bin/env perl
...
$hash{goodbye} = ()[0];
$hash{world} = ()[1];
print Dumper \%hash;
- or download this
$VAR1 = {
'hello' => 1,
...
'world' => undef,
'mars' => 4
};
- or download this
#!/usr/bin/env perl
...
@hash{'goodbye', 'world'} = ('farewell');
print Dumper \%hash;
- or download this
$VAR1 = {
'hello' => 1,
...
'world' => undef,
'mars' => 4
};