develooper Front page | perl.beginners | Postings from February 2002

What's up with STDOUT in a function call?

Thread Next
From:
Steven M. Klass
Date:
February 28, 2002 07:43
Subject:
What's up with STDOUT in a function call?
Message ID:
200202281542.g1SFgWc15536@vivids1.nsc.com
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

 steven.klass@nsc.com
 http://www.nsc.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About