You declare the format you want with 'format'. You print the data with 'write'. i.e. to print out each sname and class you would use
write($item->{'sname'}, $item->{'class'});
UPDATE: The example is wrong. See cdarkes example how it is done
A small hint: Try first with a very simple format and only one variable (maybe copy an example from the perl documentation), then built up to what you want in small steps and test your script inbetween whether it still works. If it doesn't work anymore you know exactly which change produced the wrong result and can retrace your steps and try something else or correct it
In reply to Re: Perl Format on arrays
by jethro
in thread Perl Format on arrays
by jazzaddict
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |