Data::Bind - Bind and alias variables


Data-Bind documentation  | view source Contained in the Data-Bind distribution.

Index


NAME

Top

Data::Bind - Bind and alias variables

SYNOPSIS

Top

  use Data::Bind;

  # bind simple variables
  sub foo {
    my $y = 10;
    my $x;

    bind_op('$x' => $y);
  }

  # bind for subroutine calls
  Data::Bind->sub_signature
    (\&formalize,
     { var => '$title' },
     { var => '&code'},
     { var => '$subtitle', optional => 1 },
     { var => '$case', named_only => 1 },
     { var => '$justify', named_only => 1 });
  sub formalize {
    my ($title, $subtitle, $case, $justify);
    Data::Bind->arg_bind(\@_);
  }

  formalize([\('this is title', sub { "some code" }) ], # positional
            { subtitle => \'hello'} ); #named

DESCRIPTION

Top

This module implements the semantics for perl6-style variable binding, as well as subroutine call argument passing and binding, in Perl 5.

AUTHORS

Top

Chia-liang Kao <clkao@clkao.org>

COPYRIGHT

Top

SEE ALSO

Top

Sub::Multi

TODO: Add a good reference to Perl6 multiple dispatch here.

TODO: Add a good reference to Perl6 variable binding semantics

AUTHORS

Top

Chia-liang Kao <clkao@clkao.org>

COPYRIGHT

Top


Data-Bind documentation  | view source Contained in the Data-Bind distribution.