Dear all,
I have created a script that populates an array. The script was initially developed on a Windows platform and the script then ported across to Solaris. The only things that changed were any filesystem references from \..\ to /.../.
However, I have experienced a problem populating an array. On the Windows system this works ok, on the Unix system, although the array does seem to be populated, when I print the array or try to reference the array, the value is 0.
Strange because it works ok on the Windows platform.
Any ideas = much appreciated.
Alf
Code:
#!/usr/perl5/5.6.1/bin/perl
use File::Copy;
use File::stat;
use Time::Local;
sub file_list {
@dirlisting = system "/usr/bin/ls /tmp";
print "dirlisting should be full\n\n";
print @dirlisting;
}
file_list();
I have created a script that populates an array. The script was initially developed on a Windows platform and the script then ported across to Solaris. The only things that changed were any filesystem references from \..\ to /.../.
However, I have experienced a problem populating an array. On the Windows system this works ok, on the Unix system, although the array does seem to be populated, when I print the array or try to reference the array, the value is 0.
Strange because it works ok on the Windows platform.
Any ideas = much appreciated.
Alf
Code:
#!/usr/perl5/5.6.1/bin/perl
use File::Copy;
use File::stat;
use Time::Local;
sub file_list {
@dirlisting = system "/usr/bin/ls /tmp";
print "dirlisting should be full\n\n";
print @dirlisting;
}
file_list();