Perl Hash...

Net::OpenID::ConsumerGoogleOpenID 登入時一直讀不到,trace 後找到問題出在 args

my $csr = Net::OpenID::Consumer->new(
    ua => LWPx::ParanoidAgent->new,
    args => sub { $self->request->query_parameters->{shift} },
    consumer_secret => 'some random string',
    required_root => 'http://example.com/'
);

vim 裡面突然看到 shift 顏色不太對,才突然想到,是不是 Perl 把「shift」當作是一個字串?

果然改成 shift() 就都正常了...

PS:用 Tatsumaki 拆 Controller 的部份還不錯...

One thought on “Perl Hash...”

Leave a Reply

Your email address will not be published. Required fields are marked *