> Gunnar Hjalmarsson wrote:
>>> William M West wrote:
>>>>
>>>> @creds = grep {/./} $fh;
>>>
>>> Try:
>>>
>>> @creds = grep {/./} <$fh>;
>>
>> ah!! i was so used to that /not/ being the case with a normal
>> filehandle
>
>Don't understand. Which syntax(es) are you referring to when saying
that?
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.
but of course that's NOT the same as :
my @array =grep {/foo/} <LS2>;
which is fine- my careless reading of my other code got the misuse of <>
stuck in my head- that kept me from seeing the proper solution.
willy
http://www.hackswell.com/corenth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>