Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 examining the Monastery: (5)
As of 2018-09-25 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (196 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!