http://qs321.pair.com?node_id=55330


in reply to Re: Re: push
in thread push

If you may have more than one value that you want to save, I'd use an array of (references to) hashes; at least, sticking with the structure you've already got. For that, you're going to need to read up on references, so perldoc perlref and perldoc perlreftut are your starting points. something like the following should get you started:

my @lines; # ... as before # instead of *your* push line, @facdata{@facfields} = @facrow; push @lines, \%facdata;

That will leave you with an array of references to hashes. This is a little hairier than the structure you might want (you could, e.g. just store an array of strings, and call the splits on those later. But whatever ...)

Philosophy can be made out of anything. Or less -- Jerry A. Fodor