in reply to grep and arrays

@array2 will be empty if there are no matches. A way to test this condition is:
if (@array2) { # array2 is not empty } else { # array2 is empty }
Used in this way, @array2 returns its size. So, you can write tests like this:
if (@array2 > 3) { # array2 has more than three elements }
The first test is short-hand for if (@array2 != 0) { ....