ArrayHashSearch

Search utility for arrays and hashes in Perl
Download

ArrayHashSearch Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Serge Tsafak
  • Publisher web site:
  • http://search.cpan.org/~tsafserge/

ArrayHashSearch Tags


ArrayHashSearch Description

Search utility for arrays and hashes in Perl ArrayHashSearch is a Perl module that provides routines to search content of n-dimensional arrays and/or hashes for given values.These routines are useful for people who often test existence of specific values in complex data structures returned by other routines.Since there are currently no such built-in functions to search arrays/hashes, one can save time by using this module.Synopsis use ArrayHashSearch; my $dummyarrayref = ; my $dummyarrayref2 = ; if (array_contain($dummyarrayref,7)) { print "Value 7 exists in the array!"; } if (array_deeply_contain($dummyarrayref2,7)) { print "Value 7 exists in the array!"; } A more complex example: use strict; use warnings; use ArrayHashSearch; my $dummyarray1 = ; my $dummyarray2 = ; my $dummyarray3 = ; my $dummyhash1 = {1=>'a',2=>'b',3=>'c'}; my $dummyhash2 = {1=>$dummyhash1,2=>'d',3=>'e'}; my $dummyhash3 = {1=>'f',2=>'g',3=>$dummyhash2}; my $dummystructure1 = ; my $dummystructure2 = {1=>'h',2=>$dummystructure1,3=>'i'}; print "ARRAY BINGO!\n" if array_deeply_contain($dummyarray3,5); print "HASH BINGO!\n" if hash_deeply_contain($dummyhash3,'a'); print "ARRAY/HASH BINGO!\n" if deeply_contain($dummystructure1,5); print "HASH/ARRAY BINGO!\n" if deeply_contain($dummystructure2,'a'); Requirements: · Perl


ArrayHashSearch Related Software