R
Rose
Yesterday I was taught that I can use
\@array to refer an array and it does not make a copy of itself.
Indeed i don't quite understand what it means.
Today, I encounter another mysterious symbol \&, could anybody tell me what
\ and & are for?
my %sorted_features;
for my $f (@features) {
my $tag = $f->primary_tag;
push @{$sorted_features{$tag}},$f;
}
if ($sorted_features{obj}) {
$panel->add_track($sorted_features{obj},
$panel->add_track(-label => \&Label,);
}
sub Label
{
my $feature = shift;
my @notes;
foreach (qw(product result))
{
next unless $feature->has_tag($_);
@notes = $feature->each_tag_value($_);
last;
}
$notes[0];
}
\@array to refer an array and it does not make a copy of itself.
Indeed i don't quite understand what it means.
Today, I encounter another mysterious symbol \&, could anybody tell me what
\ and & are for?
my %sorted_features;
for my $f (@features) {
my $tag = $f->primary_tag;
push @{$sorted_features{$tag}},$f;
}
if ($sorted_features{obj}) {
$panel->add_track($sorted_features{obj},
$panel->add_track(-label => \&Label,);
}
sub Label
{
my $feature = shift;
my @notes;
foreach (qw(product result))
{
next unless $feature->has_tag($_);
@notes = $feature->each_tag_value($_);
last;
}
$notes[0];
}