in reply to RE: (2) (Package Data) RE: (3) You can't get there from here....
in thread References of Eternal Peril
There. You name your variables only once (outside of the template section), bind them to columns for speed, and are able to access them via a hash lookup. No symbolic references, and the only ugly construct is making a list of references from a hash slice. That beats the map stuff in my book, and it looks like a spaceship. You can't go wrong there.#!/usr/bin/perl -w use strict; my %h; my @cols = qw( one two three four ); @h{@cols} = ( 1 .. 4 ); assign( \( @h{ @cols } ) ); print "$_ => $h{$_}\n" foreach @cols; sub assign { my $val = 0; foreach (@_) { $$_ = $val++; } }
|
|---|