This is code my perl file :
#!/opt/local/bin/perl
use strict;
use warnings;
use WWW::Myspace;
$| = 1;
my $username = 'bladekhanh85@yahoo.com.vn';
my $password = "0909134797";
my @friends;
print "Username: $username\tPassword: $password\n";
print "Logging in... ";
my $myspace = WWW::Myspace->new( $username, $password );
print "done\n";
if ( ! $myspace->logged_in ) {
print "Unable to login: " . $myspace->error . "\n";
}
# Get list of your friends
print "Getting friends... ";
@friends = $myspace->get_friends;
print "done\n";
my $friend;
foreach $friend (@friends) {
eval {
print "friend id.:". $friend ."\n";
my $friend_name = $myspace->friend_user_name($friend);
print "name......:" . $friend_name . "\n";
my $last_login = $myspace->last_login_ymd($friend);
print "last login:". $last_login. "\n\n";
};
if ($@) {
print "Unable to complete request: $@\n\n";
}
}
###################################### Console ######################################################
Username: bladekhanh85@yahoo.com.vn Password: 0909134797
Logging in... done
Getting friends... done
friend id.:
Use of uninitialized value $friend in concatenation (.) or string at /root/workspace/OpenSocial/get_profile.cgi line 31.
Use of uninitialized value $friend_id in pattern match (m//) at /usr/local/share/perl/5.10.1/WWW/Myspace.pm line 2081.
Use of uninitialized value $friend_id in concatenation (.) or string at /usr/local/share/perl/5.10.1/WWW/Myspace.pm line 2085.
Error getting page:
500 Can't connect to home.myspace.com:80 (Bad hostname 'home.myspace.com')
Can't call method "decoded_content" on an undefined value at /usr/local/share/perl/5.10.1/WWW/Myspace.pm line 1728.
#################################################################################
When i debuged a line "@friends = $myspace->get_friends;". Value of friends is null. I don't understand why, although connected to my account