I am trying to parse a string and place the parts in an array, and then assign the array components to new variables. I have done this the exact same way in my code and it works, but now it fails, and I have no clue why. I think it is something simple, and I am too close to see it.
sub timeDiff {
my ($tday,$tmon,$tyear,$pday,$pmon,$pyear,$tvalue,$pvalue,$reset);
my (@arrSplitTDate,@arrSplitPDate,$arrSplitTDate,$arrSplitPDate);
$tvalue = $_[0];
$pvalue = $_[1];
print $tvalue;
print $pvalue;
@arrSplitTDate = split(/\//, $tvalue);
$tday = $arrSplitTdate[1];
$tmon = $arrSplitTdate[0];
$tyear = $arrSplitTdate[2];
print $tday . "\n";
print $tmon . "\n";
print $tyear . "\n";
}
This is the error:
Global symbol "@arrSplitTdate" requires explicit package name at LargeLDAPSearch.pl line 173, <DATA> line 558.
Anyone see the reason for the error? Thank you.
Your camelCasing is different between variable declaration and intended use.
arrSplitTDatevs.arrSplitTdate