Lol opps.
my $count = 0;
foreach ( @record ) {
my $length = length( $_ );
$widths[ $count ] = $length if ( $widths[ $count ] < $length );
$count++;
push ( @sheet, [ @record ] );
}
Paul Kraus
-----------------------
PEL Supply Company
Network Administrator
> -----Original Message-----
> From: James Edward Gray II [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 22, 2004 9:31 AM
> To: Paul Kraus
> Cc: 'Perl Beginners'
> Subject: Re: Learning to use map and grep
>
> On Jan 22, 2004, at 8:24 AM, Paul Kraus wrote:
>
> > This is a simple bit of code that scans through a file and determines
> > the
> > width setting for columns that will eventually be written out using
> > spreadsheet::writexcel. It works fine but I am curious if there is a
> > way to
> > do it with map or grep that would be better? This is more for learning
> > the
> > practicality. Thanks.
>
> I think you forgot to attach some code to that. ;)
>
> James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>