我收到以下错误:
Use of uninitialized value $_ in concatenation (.) or string at checkfornewfiles.pl line 34.
Run Code Online (Sandbox Code Playgroud)
尝试运行以下代码时:
#!/usr/bin/perl -w
#Author: mimo
#Date 3/2015
#Purpose: monitor directory for new files...
AscertainStatus();
######### start of subroutine ########
sub AscertainStatus {
my $DIR= "test2";
####### open handler #############
opendir (HAN1, "$DIR") || die "Problem: $!";
########## assign theoutput of HAN1 to array1 ##########
my @array1= readdir(HAN1);
######## adding some logic #########
if ("$#array1" > 1) { #### if files exists (more than 1) in …Run Code Online (Sandbox Code Playgroud) perl ×1