User Profile

Collapse

Profile Sidebar

Collapse
sali444
sali444
Last Activity: Apr 18 '10, 03:14 PM
Joined: Apr 8 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sali444
    replied to How to compare array items
    in Perl
    i want add joint elements to @neo.
    and print ...
    See more | Go to post

    Leave a comment:


  • sali444
    started a topic How to compare array items
    in Perl

    How to compare array items

    Hi
    Help Me Please
    Code:
    #compare @a & @b elements.
    #if $a[x] = $b[y] then add to @neo
    #print sorted list of @neo elements
    
    @a = qw(BB Ninja an FFF);
    @b = qw(ali reza cd an);
    @neo = qw();
    my $sza = @a;
    my $szb = @b;
    
    for($j=0; $j <= $szb; $j++)
    {
        for($i=0;$i <= $sza;$i++)
        {
        $c1 = $a[$j];
        $c2 = $b[$i];
            if($c1==$c2)
    ...
    See more | Go to post
    Last edited by numberwhun; May 19 '10, 02:21 AM. Reason: Please use CODE TAGS!!!
No activity results to display
Show More
Working...