Aruna Goke schreef:
Missing: #!/usr/bin/perl use strict; use warnings; > open FH, '<', $fn or die "The File $fn Could not be opened: $! \n"; > while(<FH>) > { > #split the file into variables It is not about the file but about the (or each) row. Maybe something more like: # each row contains comma separated values, split them up into an array > @x[0,1,2,3,4,5,6]=split/,/; There are several ways to rewrite this. I think I would go for: my @x = (split /,/)[0..6]; or if I would know that after element 6 there are not multi-megabytes of data: my @x = split /,/, $_, 8; # put the remainder in $x[7] or even just my @x = split /,/; > $x[6]=~s/\s//gm; > $sth->execute($x[2], $x[5], $x[4], $x[6]) or die "Error executing > <<$sth->{Statement}>> with values @x[2,5,4,6]: $DBI::errstr"; > } That needs reformatting, to make your code easier to read. Whitespace is cheap. $x[6] = ~s/^[[:blank:]]+//; # ltrim $sth->execute( @x[ 2, 5, 4, 6 ] ) or die "Error executing <<$sth->{Statement}>>" . " with values '@x[2, 5, 4, 6]': $DBI::errstr"; } -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/