perl雑記
2836 ワード
関数#カンスウ#
#! /usr/bin/perl
#
sub hello
{
print $_[0];
}
&hello("hello,world
");
#
sub max
{
if ($_[0] > $_[1])
{
return $_[0];
}
else
{
return $_[1];
}
}
$n = &max(10,23);
prin}
test(
アナログ関数ポインタ
#! /usr/bin/perl
sub hello
{
print $_[0];
}
&hello("hello,world
");
#
@funcPointer = (\&hello);
$funcPointer[0]->("testing...
");