in reply to getting the right stuff
If you separate out the printing, it's probably best to return a reference to @records, then pass that to the printing subroutine. You can probably also pass a list of hash keys to print (use a hash slice or a subset):use Text::ParseWords; <DATA>; while (<DATA>) { chomp; my @words = shellwords($_); print "ID: $words[0]\tCourse: $words[1]\n"; } __END__ "ID" "Course" 9414 "Nutitional Epidemiology" 9414 "Nutritional assessment" 9414 "Undernutrition in the United States" 1371 "Health Politics and Policy" 1371 "Advanced Health Politics?" 1371 "Introduction to Health Policy & Management"
I think that's what you mean.my @keys = qw ( ID Dept Fax); print ul( map { li("$_: $data{$_}") } @keys);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: getting the right stuff
by malaga (Pilgrim) on Feb 06, 2001 at 13:37 UTC | |
by arturo (Vicar) on Feb 06, 2001 at 19:20 UTC | |
by malaga (Pilgrim) on Feb 06, 2001 at 22:16 UTC | |
by davorg (Chancellor) on Feb 06, 2001 at 22:21 UTC | |
by chromatic (Archbishop) on Feb 06, 2001 at 21:24 UTC | |
by malaga (Pilgrim) on Feb 06, 2001 at 22:22 UTC |