comparison plugins/perl/scripts/count_down.pl @ 12364:6fd82071a7b8

[gaim-migrate @ 14668] sf patch #1373688, from Will Thompson "Make the Perl bindings more Perl-ish" committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 05 Dec 2005 23:54:34 +0000
parents 0e9e2b923d09
children
comparison
equal deleted inserted replaced
12363:f758af0373cb 12364:6fd82071a7b8
32 32
33 print "NUM OF ACCS: " . $accounts . "\n"; 33 print "NUM OF ACCS: " . $accounts . "\n";
34 # Search each account's user info for our tag 34 # Search each account's user info for our tag
35 foreach $acc (@accounts) { 35 foreach $acc (@accounts) {
36 print "IN ACCOUNTS\n"; 36 print "IN ACCOUNTS\n";
37 $user_info = Gaim::Account::get_user_info($acc); 37 $user_info = $acc->get_user_info();
38 print "USER INFO 1: " . $user_info . "\n"; 38 print "USER INFO 1: " . $user_info . "\n";
39 # Find <countdown> and replace 39 # Find <countdown> and replace
40 $user_info =~ /countdown([0-9]+).([0-9]+).([0-9]+)/; 40 $user_info =~ /countdown([0-9]+).([0-9]+).([0-9]+)/;
41 print "Found: " .$1 . " " . $2 . " " . $3 . "\n"; 41 print "Found: " .$1 . " " . $2 . " " . $3 . "\n";
42 $days = count_days($1, $2, $3); 42 $days = count_days($1, $2, $3);
43 $user_info =~ s/countdown(\d\d\d\d).(\d\d).(\d\d)/$days/; 43 $user_info =~ s/countdown(\d\d\d\d).(\d\d).(\d\d)/$days/;
44 print "USER INFO 2: " . $user_info . "\n"; 44 print "USER INFO 2: " . $user_info . "\n";
45 # Gaim::Account::set_user_info($acc, $user_info); 45 # $acc->set_user_info($user_info);
46 46
47 } 47 }
48 48
49 eval ' 49 eval '
50 use Gtk2 \'-init\'; 50 use Gtk2 \'-init\';
68 my ($widget, $window) = @_; 68 my ($widget, $window) = @_;
69 print "Called from sub hello!\n "; 69 print "Called from sub hello!\n ";
70 print "Test var: " . $GLOBAL_TEST_VAR . " \n"; 70 print "Test var: " . $GLOBAL_TEST_VAR . " \n";
71 @accounts = Gaim::Accounts::get_all(); 71 @accounts = Gaim::Accounts::get_all();
72 $acc = $accounts[0]; 72 $acc = $accounts[0];
73 $user_info = Gaim::Account::get_user_info($acc); 73 $user_info = $acc->get_user_info();
74 print "USER INFO from sub hello: " . $user_info . "\n"; 74 print "USER INFO from sub hello: " . $user_info . "\n";
75 $window->destroy; 75 $window->destroy;
76 } 76 }
77 77
78 sub count_days { 78 sub count_days {