Help for this page

Select Code to Download


  1. or download this
    my $function = sub {
        # ...do stuff...
    ...
    
    # Call the sub
    $function->('param');
    
  2. or download this
    sub function {
        # ...do stuff...
    ...
    
    # Call the sub
    function('param);
    
  3. or download this
    my $vars = {
        'date'    => $date,
        'format'  => sub { return ucfirst lc $_[0]; },
    };
    $template->process('example.tt', $vars);