bjohn has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl/ print "enter values.\n"; @value = (); while ($value = <>){ chomp($value); if ($value eq ""){ last;} @value = (@value , $value); } $count = 0; foreach $line (@value) { $count++; @z =split('', $line); $count = @z; } print "$count items\n"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: having trouble with count
by toolic (Bishop) on Mar 22, 2011 at 14:04 UTC | |
by bjohn (Initiate) on Mar 22, 2011 at 14:09 UTC | |
|
Re: having trouble with count
by johngg (Canon) on Mar 22, 2011 at 14:18 UTC | |
|
Re: having trouble with count
by choroba (Cardinal) on Mar 22, 2011 at 14:12 UTC |