in reply to Can someone Explain 2 lines of code
$count{$_}++ for @Clec_id; print "$_ => $count{$_}\n" for keys %count;can someone please explain
Well, I got here too late and other people had already explained. So instead, I decided to play games with it, like getting it onto one line and getting rid of the well-named variables. (Honestly, naming a variable "count" when it's perfectly obvious that it's a counting variable... if you're not careful, people will be able to read your code...) So, um, this may not be helpful or answer your question, but it was fun:
print"$_ => $}{$_}\n"for grep{!$!{$_}++}map{$}{$_}++;$_}@Clec_id;$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can someone Explain 2 lines of code
by sauoq (Abbot) on Oct 29, 2003 at 01:57 UTC | |
by jonadab (Parson) on Oct 29, 2003 at 19:35 UTC |