use AnyEvent; use AnyEvent::Util 'fork_call'; my $mtgox = Local::Finance::MtGox->new({ key => 'key', secret => 'secret' }); $mtgox->{mech}->ssl_opts(verify_hostname => 0); my $cv = AE::cv; fork_call { $mtgox->call_auth('getFunds') } sub { dd @_; $cv->send }; $cv->wait;