Help for this page

Select Code to Download


  1. or download this
    
            ## Calculate a new field's values based on two others
    ...
            $t->col('PersonID');
            $t->calc(sub{no strict 'vars'; $PersonID = "$Last$First"});
    
  2. or download this
    sub calc
    {
    ...
        ## Return scalar column ref unless return context is undef
        return($WantVals ? $Vals : ());
    }
    
  3. or download this
    ## Don't overwrite fields in package main.
    my @saveFields;
    ...
    ## Restore fields in main
    no strict 'refs'; package main;
    foreach my $F (@$Fields) { ${$F} = shift @saveFields; };
    
  4. or download this
    #!/usr/bin/perl
    
    ...