West, William M wrote:

my @array =grep {-d "$directory\/$_"} readdir <LS2>;

gives me this error::

Type of arg 1 to readdir must be HANDLE (not <HANDLE>) at ./subdirs.pl
line 30, near "<LS2>;"
Execution of ./subdirs.pl aborted due to compilation errors.

The expression "readdir <LS2>;" is the same as "readdir readline LS2;". Whenever you see a FILEHANDLE delimited by < and > it the same as using readline with that FILEHANDLE.


perldoc -f readline


John -- use Perl; program fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to