jazzaddict has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks,
I'm new to perl, and I've been looking at working example of how I may utilise Perl format to style my output in a certain manner. Many of these examples show that this reporting feature is based around the filehandler, problem is i'm pulling stuff out of arrays. I'm kindna clueless on how should I go about this. Any advise is appreciated. Thank you.
for example
sub test{ foreach my $stuffs (@{$object->{'school'}}) { print "Student Name: $item->{'sname'}\n" ; print "class: $item->{'class'}\n\n"; print "enrolled Date: $item->{'EnrolDate'}\n\n"; print "class id: $item->{'classid'}\n\n"; } }
Instead of using print, I want to use format. In this case, how should I use format? is the format name test? which variables should I use for the format pictures?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Format on arrays
by cdarke (Prior) on Apr 18, 2011 at 09:43 UTC | |
by tospo (Hermit) on Apr 18, 2011 at 10:25 UTC | |
|
Re: Perl Format on arrays
by jethro (Monsignor) on Apr 18, 2011 at 09:40 UTC |