- 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"});
- or download this
sub calc
{
...
## Return scalar column ref unless return context is undef
return($WantVals ? $Vals : ());
}
- 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; };
- or download this
#!/usr/bin/perl
...