=encoding utf8
=for stopwords
YAMASHINA
Hio
ACKNOWLEDGEMENTS
AnnoCPAN
CPAN
RT
OO-style
ccall
=head1 NAME
Contextual::Call - call sub with caller's context
J<< ja; Contextual::Call - 呼び出し元のコンテキストで関数呼び出し >>
=head1 VERSION
Version 0.01
=head1 SYNOPSIS
use Contextual::Call qw(ccall);
# invoke sub with your context.
my $cc = ccall($coderef);
... some processes ..
# and return value which was returned by $coderef and
# is matched with context.
return $cc->result;
=head1 DESCRIPTION
L function can invoke a function undef specified context
(default is caller's context) and reproduce return value of that
invocation.
J<< ja;
L 関数は特定のコンテキスト(デフォルトでは呼び出した関数の
コンテキスト)での関数呼び出しと, その呼び出し結果から復帰値の
再生成を行うことができます.
>>
This function is useful when you will override a method
which returns different values between scalar and list context.
J<< ja;
コンテキストによって復帰値が変わるメソッドをオーバーロード
する時に便利です.
>>
=head1 EXPORT
This module can export C function.
J<< ja;
C 関数をエクスポートできます.
>>
=head1 FUNCTIONS
=head2 ccall
$cc = ccall($coderef);
Call specified code-ref with your context, and return
a Contextual::Call object which contains result of that call.
You can get the result appropriate for context.
J<< ja;
指定した関数リファレンスを ccall を呼び出した関数と同じ
コンテキストで呼び出します. 呼び出した結果を格納した
Contextual::Call インスタンスを返します.
結果は後でインスタンスからコンテキストにあった形で
取り出すことができます.
>>
This function is shortcut to L constructor.
J<< ja;
この関数は L コンストラクタのお手軽形です.
>>
=head1 CONSTRUCTOR
=head2 new
$obj = Contextual::Call->new({ context => wantarray, sub => $coderef });
Call specified code-ref with your context,
and return a Contextual::Call object.
This method is OO-style of L function.
J<< ja;
指定した関数リファレンスを ccall を呼び出した関数と同じ
コンテキストで呼び出します. 呼び出した結果を格納した
Contextual::Call インスタンスを返します.
このメソッドは L 関数のオブジェクト指向形式です.
>>
=head1 METHODS
=head2 result
return $obj->result();
Return result value with same context with ccall/new.
J<< ja;
ccall/new を呼び出した時と同じコンテキストで呼び出し結果を返します.
>>
=head1 AUTHOR
YAMASHINA Hio, C<< >>
=head1 BUGS
Please report any bugs or feature requests to
C, or through the web interface at
L.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
J<< ja;
バグや要望は C 宛に
報告してください. 若しくは
L.
にある web インターフェースからでもかまいません.
そこから私に通知され, そして私が変更を行うことで報告頂いたバグの進捗を
自動的にあなたに伝えるでしょう.
>>
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
J<< ja;
このモジュールのドキュメントは perldoc コマンドで見ることが出来ます.
>>
perldoc Contextual::Call
You can also look for information at:
J<< ja;
また, 以下の場所でも見ることが出来ます:
>>
=over 4
=item * AnnoCPAN: Annotated CPAN documentation
L
=item * CPAN Ratings
L
=item * RT: CPAN's request tracker
L
=item * Search CPAN
L
=back
=head1 ACKNOWLEDGEMENTS
=head1 COPYRIGHT & LICENSE
Copyright 2007 YAMASHINA Hio, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
J<< ja;
このプログラムはフリーソフトウェアです。あなたは Perl と同じ
ライセンスの 元で再配布及び変更を行うことが出来ます.
>>