Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Can't use undefined value as filehandle" AIX 5.3

Status
Not open for further replies.

rwalters

MIS
May 31, 2007
5
0
0
US
We are currently contemplating moving from AIX 5.2 to 5.3. The following example perl script works fine in 5.2, both has a script and compiled. In AIX 5.3 it works as a script, but gives "Can't use an undefined value as filehandle reference" when it is compiled. If I comment out the getopts statement, and compile it, it works fine. What am I missing?

#!/usr/bin/perl

use Getopt::Std;

getopts('p');

open(MBLIST,"ls -1 | ");
while(<MBLIST>)
{
print $_;
}
close(MBLIST);


I am not an expert perl person by any stretch of the imagination. Any help will be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top