perl勉強メモ

Net::Twitterを使ってのperl の勉強
perl を使ってのtwitter replies の取得

#!/usr/bin/perl

use strict;
use warnings;
use Net::Twitter;

my $twit = Net::Twitter->new(
    username => 'username',  #ユーザー名
    password => 'password',  #パスワード
    );

my $response = $twit->replies();

print $response,"\n";

上記を実行してみると
ARRAY(0x98e4310)
という値が返ってくる。=配列のリファレンスが値として返ってくる。

配列リファレンスを表示する

配列のリファレンスをデリファレンスして、再度実行してみる。

print @{ $response };

上記のようにデリファレンスして実行してみると
HASH(0x9431620)HASH(0x9431880)
のような値が返ってくる

配列のリファレンスのなかに
ハッシュのリファレンスが入っているということになる。