Re: spreadsheets to ldif (trouble looping through array)..

2005-09-17 Thread John W. Krahn
Harold Castro wrote: > > #This line is too tricky for me, all I know is that it > has a ternary hook operator which returns $_ if the > expression my @fields = map length() is true, > otherwise, substitute empty fields with 'NA'. I looked > into perldoc -f map as well as length() and as far as > I

Re: spreadsheets to ldif (trouble looping through array)..

2005-09-15 Thread Harold Castro
Hi John! --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Here is one way to do it: > > my @array = qw( favorite lessfavorite worstfavorite > ); > > while ( ) { > chomp; > my @fields = map length() ? $_ : 'NA', split > /:/, $_, -1; > > next unless @fields == @array; > > my %pa

Re: spreadsheets to ldif (trouble looping through array)..

2005-09-15 Thread John W. Krahn
Harold Castro wrote: > Good day! Hello, > I'm about to transfer our ip allocation table from > openoffice spreadsheet into an ldif format. The > spreadsheet has 19 columns, some cells are empty > though. So far this is what I got: > > #!/usr/local/bin/perl > use warnings; > use strict; > > my $