On 7/5/06, John W. Krahn wrote:
#!/usr/bin/perl
use warnings;
use strict;
sub _print_format1 {
# output table 1, with 3 columns
$^A = '';
formline <<'FORMAT', @_;
@<<<<<<<<<<<<<< @>>>>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<
FORMAT
$^A;
}
Wow. That's... impressive. Very "perl-foo-ish" :)
A simple and nice solution, kind-of bypassing the entire FORMAT and
write mechanism and going right to the internals. I like it :)
After looking at the docs again I also found this solution. The
problem is, I don't understand what it does :)
use FileHandle;
#...
sub _print_format2 {
# output table 2, with 6 columns
my($clock,$skew,$num_ffs,$max_lat,$min_lat,$max_tran) = @_;
format_name OUT "NEWOUT";
format NEWOUT =
@<<<<<<<<<<<< @>>>>>>>>>>>>> @>>>>>>>>> @>>>>>>>>>>>>> @>>>>>>>>>>>>>
@>>>>>>>>>>>>>>>
$clock, $skew, $num_ffs, $max_lat, $min_lat, $max_tran
.
write OUT;
}
What exactly does 'format_name OUT "NEWOUT";' *do*?
Well, I now have like 4 different working solutions to this problem.
Just have to choose... :)
Thanks,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>