Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Code Works But Not Sure How

by jwkrahn (Monsignor)
on Feb 11, 2018 at 05:27 UTC ( #1208941=note: print w/replies, xml ) Need Help??


in reply to Code Works But Not Sure How

1nickt: my @quoted = map { '$_' } @array; should be my @quoted = map { "'$_'" } @array; or my @quoted = map "'$_'", @array;.

RichHamilton, you have an off-by-one error here:

my $items = $#{$self->{menu_items}}; for (my $item = 0; $item < $items; $item++) ^^^

$#{$self->{menu_items}} is the index of the last element of the array @{$self->{menu_items}}, and you are traversing the array from zero to the element just before the last element, so the last element of the array will not be modified.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208941]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-07-20 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (423 votes). Check out past polls.

    Notices?