CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [perlFun] question about using m (match operator) with arrays: Edit Log



FishMonger
Veteran / Moderator

Jun 14, 2013, 11:55 AM


Views: 457
Re: [perlFun] question about using m (match operator) with arrays

The sub is being passed the last index number of each array, not their contents.

So, if @arr1 had 3 elements and @arr2 had 5 elements, then the sub would receive 2 and 4 as its first 2 args. Using a regex to compare the numbers does not make sense. It would be better to test using the == numerical comparison operator instead.


(This post was edited by FishMonger on Jun 14, 2013, 11:56 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Jun 14, 2013, 11:56 AM
Post edited by FishMonger (Veteran) on Jun 14, 2013, 11:56 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives