you need to pass the reference to the glob type of a filehandle.

\STDOUT isn't a ref (errors everywhere).
\*STDOUT is.

This will work:

&PrintSummary (\*STDOUT);

sub PrintSummary {
   $prtout = shift;
   print $prtout "This is a test"
}

-----Original Message-----
From: Steven M. Klass [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 10:38 AM
To: [EMAIL PROTECTED]
Subject: What's up with STDOUT in a function call?


Hi all,

        Heres a simple one

&PrintSummary ("STDOUT", /%runset);

sub PrintSummary {
   $prtout = shift;
   print $prtout "This is a test"
}

Why doesn't this work?

I get the error 
Can't use string ("STDOUT") as a symbol ref while "strict refs" is in use at

foo.pl line 5.

How can I get around this?
-- 

 Steven M. Klass
 Physical Design Manager

 National Semiconductor Corp
 7400 W. Detroit Street
 Suite 170
 Chandler AZ 85226

 Ph:480-753-2503
 Fax:480-705-6407

 [EMAIL PROTECTED]
 http://www.nsc.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to