G
George R. Gonzalez
I get:
Useless use of private variable in void context at b.pl line 588,
which is the last line of this sub, '$A", the returned value.
The weird thing is this has been working fine for weeks,
now it starts to complain!
Any ideas?
sub LookForDirLo{ my( $pat, $Base ) = @_; my( @D, $f, $fn, $A );
$A = '';
##print "lookfordirlo of '$Base'\n";
if( $Base =~ /$pat/i ) { $A = $Base; print "Setting A to '$A'" }
else {
if( -d $Base ) {
if( -r $Base ) {
if( opendir( DIR, $Base ) ) {
@D = readdir( DIR ); closedir( DIR );
if( scalar @D == 0 ) { Warn "Empty directory info returned for
'$Base'" }
foreach $f ( @D ) {
if( $A eq '' ) {
if( $f eq '.' or $f eq '..' ) { }
else {
$fn = "$Base\\$f";
if( -d $fn ) { $A = LookForDirLo( $pat, $fn ) }
}
}
}
}
else { Warn "opendir failed: Cant grovel in folder '$Base', System said:
'$!'" }
} else { Warn "LookForDirLo found that '$Base' is not readable!" }
} else { Warn "LookForDirLo found that '$Base' is not a directory!" }
$A;
}
Useless use of private variable in void context at b.pl line 588,
which is the last line of this sub, '$A", the returned value.
The weird thing is this has been working fine for weeks,
now it starts to complain!
Any ideas?
sub LookForDirLo{ my( $pat, $Base ) = @_; my( @D, $f, $fn, $A );
$A = '';
##print "lookfordirlo of '$Base'\n";
if( $Base =~ /$pat/i ) { $A = $Base; print "Setting A to '$A'" }
else {
if( -d $Base ) {
if( -r $Base ) {
if( opendir( DIR, $Base ) ) {
@D = readdir( DIR ); closedir( DIR );
if( scalar @D == 0 ) { Warn "Empty directory info returned for
'$Base'" }
foreach $f ( @D ) {
if( $A eq '' ) {
if( $f eq '.' or $f eq '..' ) { }
else {
$fn = "$Base\\$f";
if( -d $fn ) { $A = LookForDirLo( $pat, $fn ) }
}
}
}
}
else { Warn "opendir failed: Cant grovel in folder '$Base', System said:
'$!'" }
} else { Warn "LookForDirLo found that '$Base' is not readable!" }
} else { Warn "LookForDirLo found that '$Base' is not a directory!" }
$A;
}