in reply to Newbee to Perl and the error
Don't do this. It just makes your code hard to read (and to maintain) - this is Perl not C.$SYS_TYPE=1; ... if ($SYS_TYPE == 1) {
So rather:
All-caps are usually used for constants, not for normal variables.$sys_type = "AIX"; ... if ($sys_type eq "AIX") {
And when an open fails $! contains the error-message from the OS (which is very useful), so rather than
do it like this:open (DF, $FILE) || die "Can't Open File: $FILE\n";
open my $df, "<", $file or die "Can't Open File: $file: $!\n
|
|---|