On Mon, Jun 11, 2001 at 01:42:47PM -0400, McIntyre, Terry wrote:
> THe following code works on my AIX machines, 
> but not on Solaris machines. All are running Perl 5.005_03.
> 
> What's the story?
> 
> Thanks!
> 
> #!/usr/local/bin/perl -w
> 
> print "account = " ;
> $account = readline STDIN ;
> chomp($account);
> print "account: $account\n";

Seems to me you want a typeglob rather than a bare filehandle for
readline (perldoc -f readline). So, 

$account = readline (*STDIN);

But just reading the filehandle using

$account = <STDIN>;

or 

while (defined($account = <STDIN>))

ought to be just fine.

I don't know of any situations where you'd prefer readline to <>, and
the latter is certainly more idiomatic.

cheers
rob c

Reply via email to