On Thu, 27 Jan 2005 16:11:15 +0530, Ankur Gupta
<[EMAIL PROTECTED]> wrote:
> I think you can't pass filehandles directly to a sub.
> You need to use typeglob.
> 
> Just add this after opening the file.
> my $file = *INPUT;
> 
> $message = &processTextMails($file);
> sub processTextMails
> {
>         my $file = shift;
>   while(<$file>)
>   {
>        $returnMessage=$returnMessage.$_;
>   }
>   close($file);
>   return $returnMessage;
> }
> 
> I hope this works.
> 
> --
> Ankur
> 

Or if it's a simple app, since you use while(<INPUT>)  in the
subroutine, you don't actually need to pass the subroutine anything at
all. as long as INPUT is open before you call the subroutine, you
should be able to just call:

 $message = &processTextMails() ;

HTH,

--jay

-- 
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