リファレンスの判定if(ref($hoge eq 'SCALAR' || ref($hoge) eq ''){}elsif(ref($hoge eq 'ARRAY'){}elsif(ref($hoge eq 'HASH'){}