obdulio santana wrote:
I must mix 3 files, and produce a little report but in line 23 and 31 is a
warning of uninitalized value I really don't see the mistake.
use warnings;
use strict;
@lfile0 = <DATA>;
chomp @lfile0;
@meses = qw(ene feb mar abr may jun jul ago sep oct nov dic);
@files= glob "78*";
my %textos;
for (@files){
open FILE,"<$_";
$textos{$_}=[<FILE>];
chomp @{$textos{$_}};
s/.{5}// for @{$textos{$_}};
}
($day,$month,$year) = (localtime)[3..5];
$dec = $day /10;
$month++;
$dec = 3 if $dec < 1;
$year+=1900;
$file = sprintf "vcl%02d%02d%4d.txt",$day,$month,$year;
open FILEOUT, ">$file";
print FILEOUT "Resumen decadal \n" ;
printf FILEOUT "$meses[$month-1]/$year;#%d \n",$dec ;
$form = "%13s" x @files ;
printf FILEOUT "%23s" . "$form\n",sort keys %textos ;
The number of conversions exceeds the number of keys by 1.
for $line (5..50){
for $line ( 5 .. 5 + $#lfile0 ) {
@str=();
for (sort keys %textos){
push @str,${$textos{$_}}[$line];
}
$form = "%13s" x @files ;
$form = "%-10s".$form."\n";
printf FILEOUT $form,$lfile0[$line-6],@str;
-----------------------------------------^
}
close FILEOUT;
<snip>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/