in reply to Re: comparing two array
in thread comparing two array
Are you aware that you are using unescaped data in a regular expression? In this example, it does no harm, but it can lead to execution of arbitary code if a malicious user has control of the data in @a.
Imagine @a = ( '(?{ `/bin/rm -rf /` })' );
Update:
As you don't match the entire value, but only a part, your algorithm will fail as soon as @b contains multi-digit numbers or strings with digits: Change @b to my @b = qw( 3 1 5 far2simple ); and your program will list 2 as one of the members of @b.
Alexander
|
|---|