Jun 27, 2006 #1 sdslrn123 Technical User Joined Jan 17, 2006 Messages 78 Location GB print FILE if ++$count{$_} < 2; Does anyone know what is being printed to the filehandle FILE?
Jun 27, 2006 #2 ishnid Programmer Joined Aug 29, 2003 Messages 1,422 Location IE The contents of the special $_ variable. Upvote 0 Downvote
Jun 27, 2006 Thread starter #3 sdslrn123 Technical User Joined Jan 17, 2006 Messages 78 Location GB Sorry, my fault, I am just trying to figure out what the whole line means? Upvote 0 Downvote
Jun 27, 2006 #4 Kirsle Programmer Joined Jan 21, 2006 Messages 1,179 Location US It prints the value of $_ to FILE, if a hash with $_ as its key has a value that is greater than 2, after adding 1 to its current value. Upvote 0 Downvote
It prints the value of $_ to FILE, if a hash with $_ as its key has a value that is greater than 2, after adding 1 to its current value.
Jun 27, 2006 #5 Kirsle Programmer Joined Jan 21, 2006 Messages 1,179 Location US er, less than 2 (was a bit dyslexic with the inequality sign there) Upvote 0 Downvote
Jun 27, 2006 #6 brigmar Programmer Joined Mar 21, 2006 Messages 414 Location US In 'longhand' it would be: Code: $count{$_} = $count{$_} + 1; if ( $count{$_} < 2 ) { print FILE $_; } Upvote 0 Downvote
In 'longhand' it would be: Code: $count{$_} = $count{$_} + 1; if ( $count{$_} < 2 ) { print FILE $_; }