Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-12-14 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (64 votes). Check out past polls.

    Notices?