in reply to Can't use an undefined value as an ARRAY reference at ./test.pl line 14.
To answer your question on how to initialize lib :
Will resolve the issue.my $lib =[]; # A reference to an empty array
Another alternative is to check for $lib to be defined before checking scalar @$lib.
...it is unhealthy to remain near things that are in the process of blowing up. man page for WARP, by Larry Wall
|
|---|