Chris Wagner wrote:

> At 02:39 PM 12/5/2006 -0500, Joe Discenza wrote:
> 
>>The tr/// operator counts all the occurrences of the translated
>>character(s) in $_ (the default), and then you just increment the @semis
>>array at the index of the number of semicolons found to indicate another
>>line with that number of semicolons.
> 
> 
> Heh, clever, but probably too clever.  That will give u an array full of
> zero's.  U can't have sparse arrays in perl.  Doing ++$semis{ tr/;/;/ };
> would be better.

Sure you can.  The unused/skipped cells will be undef which you
can check for on the print.

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to