Unix and Linux Discussions Tagged with added |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
23,672 |
What is on Your Mind? |
|
|
|
7 |
11,668 |
Red Hat |
|
|
|
4 |
1,212 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,787 |
Red Hat |
|
|
|
0 |
2,410 |
Software Releases - RSS News |
|
|
|
2 |
2,500 |
Shell Programming and Scripting |
|
|
|
1 |
3,479 |
UNIX for Dummies Questions & Answers |
|
|
|
20 |
17,845 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
72,447 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
5,119 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
26,026 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
9,049 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
4,292 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
80,048 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,098 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,652 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
10,010 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
9,096 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
4,813 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
15,865 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,342 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
3,573 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,323 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
6,228 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
18,600 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,254 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
271,240 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
7,737 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
5,446 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
3,001 |
UNIX for Dummies Questions & Answers |
Array::Diff(3pm) User Contributed Perl Documentation Array::Diff(3pm)
NAME
Array::Diff - Find the differences between two arrays
SYNOPSIS
my @old = ( 'a', 'b', 'c' );
my @new = ( 'b', 'c', 'd' );
my $diff = Array::Diff->diff( @old, @new );
$diff->count # 2
$diff->added # [ 'd' ];
$diff->deleted # [ 'a' ];
DESCRIPTION
This module compares two arrays and returns the added or deleted elements in two separate arrays. It's a simple wrapper around
Algorithm::Diff.
And if you need more complex array tools, check Array::Compare.
METHODS
new ()
Create a new "Array::Diff" object.
diff ( OLD, NEW )
Compute the differences between two arrays. The results are stored in the "added", "deleted", and "count" properties that may be
examined using the corresponding methods.
This method may be invoked as an object method, in which case it will recalculate the differences and repopulate the "count", "added",
and "removed" properties, or as a static method, in which case it will return a newly-created "Array::Diff" object with the properies
set appropriately.
added ( [VALUES ] )
Get or set the elements present in the "NEW" array and absent in the "OLD" one at the comparison performed by the last "diff()"
invocation.
deleted ( [VALUES] )
Get or set the elements present in the "OLD" array and absent in the "NEW" one at the comparison performed by the last "diff()"
invocation.
count ( [VALUE] )
Get or set the total number of added or deleted elements at the comparison performed by the last "diff()" invocation. This count
should be equal to the sum of the number of elements in the "added" and "deleted" properties.
SEE ALSO
Algorithm::Diff
AUTHOR
Daisuke Murase <typester@cpan.org>
COPYRIGHT AND LICENSE
Copyright (c) 2009 by Daisuke Murase.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.10.1 2010-10-08 Array::Diff(3pm)