內部數組編輯:推陣列的perl
我怎麼能推到@myarr $菜單(見下文)
my @myarr = (
[ "itemone", "itemoneb", "itemonec" ],
[ "itemtwo", "itemtwob", "itemtwoc" ],
[ "itemthree", "itemthewwb", "itemthreec" ],
[ "itemfour", "itemfourb", "itemfourc" ]
);
$menu = [
"List",
["itemone", \&ds2],
["itemtwo", \&ds2],
["itemthree", \&ds2],
["itemfour", \&ds2],
[ "Do Something (second)", \&ds2 ]
];
你嘗試過什麼,什麼結果是什麼?閱讀[perlreftut](http://p3rl.org/perlreftut)後不應該那麼難。 :) – memowe
您是否試圖將「itemoneb」和「itemonec」推入保存「itemone」的現有arrayref中?什麼是'&ds2'? – plusplus
爲什麼這是封閉的不是一個真正的問題。這是完全清楚的問題。 – Owl