[問題] 陣列元素變成新的陣列,怎麼找新陣列元素

看板Perl作者 (李崩子)時間12年前 (2011/11/01 16:59), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
#!/usr/bin/perl -w use strict; my @feature = qw/A B C/; my @A=(4,6); my @B=(3,5); print ${$feature[1]}[0] ; 出現error Can't use string ("B") as an ARRAY ref while "strict refs" 請問怎麼輸出 @B的元素? 謝謝大家!!! -- \ ∩──、 ===== \/ ● , \ ====== /\( ● ¯● |つ | ╳_入_ノ ミ ︵ 用這種餌 (_/ ノ / / 也想讓本大爺上鉤… /\___ノ_/ / ====== -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.215.174 ※ 編輯: sqrt1089 來自: 140.116.215.174 (11/01 17:04) ※ 編輯: sqrt1089 來自: 140.116.215.174 (11/01 17:06)

11/03 01:09, , 1F
print @{@feature[1]}[0] ;
11/03 01:09, 1F
文章代碼(AID): #1EhxJtqp (Perl)
文章代碼(AID): #1EhxJtqp (Perl)