what is this pack actually doing.... compressing the data in each element or the entire array or both?
Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Gerard Robin <[EMAIL PROTECTED] doo.fr> To beginners perl <beginners@perl.org> 01/02/2006 06:04 cc PM Subject Re: pack an array On Mon, Jan 02, 2006 at 10:07:44AM -0800, Tom Phoenix wrote: > my @pack; > my $empties = 0; > foreach my $item (@array) { > if ($item eq '') { # empty string > $empties++; > } else { > push @pack, $item; > } > } > Thanks, very nice. It's difficult (for me ;-)) to think in Perl ... Thanks also for the other hints. -- Gérard -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>