エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Perlで2階層目のハッシュを参照するときは注意が必要 - 超自己満足プログラミング
use strict; use warnings; my (%hash, $msg); $msg = (exists $hash{key}) ? "exist" : "not exist"; p... use strict; use warnings; my (%hash, $msg); $msg = (exists $hash{key}) ? "exist" : "not exist"; print "$msg\n"; # not exist # 1階層目を参照 my $tmp = $hash{key}; $msg = (exists $hash{key}) ? "exist" : "not exist"; print "$msg\n"; # not exist # 2階層目を参照 $tmp = $hash{key}{sub_key}; $msg = (exists $hash{key}) ? "exist" : "not exist"; print "$msg\n"; # exist warningすら出ません。 当然ですけど、existsではなくて、definedでも同じです。 $
2010/03/12 リンク