Hello,
I'd like to match numbers and add them to an array if the array does not
contain the number.
let's assume $part[1] can hold the values in consecutive order e.g. 5, 1005,
5, 2000.... then
next if (grep /$part[1]/, @tnumlist);
push @tnumlist,$part[1];
would yield @tnumlist = 5, 1005, 2000
if we reverse the order and $part[1] holds 1005, 5, 2000... then of course
the above expression would fail to add 5 to the array.
Besides I don't think grep is a good idea to use here anyway.
but if ( @tnumlist =~ /$part[1]/ )
doesn't find the number at all. Can someone point me out how to use the
regexp in this case correctly?
Thanks, Stefan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]