Next Hook::LexWrap 7

Examples of Tricky Features

Argument Conversion

     wrap 'get_temp',
        pre => sub { @_ = ($_[0] * 9/5 + 32) },
       post => sub { $_[-1] = ($_[-1]-32) * 5/9 };
     my $celsius = get_temp(100);   # boiling point of water


Next Copyright © 2003 M. J. Dominus