in reply to Re^2: Need to Create an Array of Differences
in thread Need to Create an Array of Differences

sorry ... is impossible to see in my previous message the -> [] 

then with square brackets visible is :

sub diff_2 {
    my @diff =  grep /[[^@{$_[0]]}]/, @{$_[1]};
    return \@diff;
}

Marco

  • Comment on Re^3: Need to Create an Array of Differences

Replies are listed 'Best First'.
Re^4: Need to Create an Array of Differences
by xtype (Deacon) on Feb 08, 2005 at 16:49 UTC
    Better?
    If that worked, it wouldn't be semantically the same as Aristotle's, Zaxo's, or my reply. Nor of the perlfaq or tachyon's (which show a difference of both arrays).

    Did you test your code? It is a nice thought, however, I cannot make that work on 5.6.1, 5.8.1, or 5.8.5
    For a simple array of int's @diff is always undef.
    For an array containing scalars I get "Invalid range in regex" error, which is what I expect.

    -xtype