Help for this page

Select Code to Download


  1. or download this
    my @array1 = qw(one two three);
    my @array2 = ("one" . $" . "two", "three");
    
    if ("@array1" eq "@array2") {
        print 'They are the same', $/;   # no, they are NOT
    }
    
  2. or download this
    my @array1 = qw(one two three);
    my @array2 = qw(onetwo three);
    
    if ( do{ local $" = ''; "@array1" eq "@array2"} ) {
        print 'They are the same', $/;   # no, they are NOT
    }
    
  3. or download this
    my @array1 = ("one", "two" . $" . "three");
    my @array2 = ("one" . $" . "two", "three");
    
    if ( do{ @array1 == @array2 and "@array1" eq "@array2"} ) { 
        print 'They are the same', $/;    # no, they are NOT
    }