Help for this page

Select Code to Download


  1. or download this
                                                                          
    +                                                           
    #!/usr/bin/perl                                                       
    +                                                                     
    +                            
    use strict;
    ...
    print "\@arr2 has both"
        if grep {/^Sun$/} @arr2
        and grep {/^Moon$/} @arr2;
    
  2. or download this
    print "\@arr1 has both"
        if grep {$_ eq "Sun"} @arr1
        and grep {$_ eq "Moon"} @arr1;