in reply to @$ variable type

The @ is used to dereference an array reference: perldoc perlreftut.

From perldoc IO::Select (for the select method):

The result will be an array of 3 elements, each a reference to an array which will hold the handles that are ready for reading, writing and have exceptions respectively.

See also: Writeup Formatting Tips

Replies are listed 'Best First'.
Re^2: @$ variable type
by Anonymous Monk on Jan 12, 2012 at 20:52 UTC
    but then why is there a foreach? What is that loop actually doing to the sets variable?

      Though select returns three elements, your code is only using the first one, $sets, a reference to an array of handles ready for reading. To de-reference this array reference $sets, you use @$sets, as described in the perlreftut link already provided by toolic. Note that @$sets is equivalent to @{$sets} (the form more commonly used in perlreftut). You need to take the time to read perlreftut and to understand how references work in Perl.