alienhuman has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl if (!$ARGV[0]) { die "Please include the name of a comma-delimited text file as + argument. "; } elsif ( ($ARGV[0] eq "help") or ($ARGV[0] eq "-h") or ($ARGV[0] eq " +--help") ) { die "Please include the name of a comma-delimited text file as + argument. "; } else { $FILE = $ARGV[0]; open FILE or die "Couldn't open file $FILE: $!\n"; #open(FILE,"$FILE") or die "Couldn't open file $FILE: $!\n"; while (<FILE>) { $file_data=<FILE>; } close FILE; @new_array = split /,/, $file_data; $i=1; open LOG, '>>./array_parser.log'; print LOG localtime() . "\n"; foreach $item (@new_array) { print LOG "Item i => $item\n"; $i++; } print LOG "-------- END --------\n\n"; close LOG; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Script doesn't enter while loop.
by Masem (Monsignor) on Aug 23, 2001 at 20:57 UTC | |
by ChemBoy (Priest) on Aug 23, 2001 at 21:28 UTC | |
|
Re: Script doesn't enter while loop.
by VSarkiss (Monsignor) on Aug 23, 2001 at 21:03 UTC | |
|
Re: Script doesn't enter while loop.
by Sifmole (Chaplain) on Aug 23, 2001 at 23:01 UTC |