![]() |
![]()
| ![]() |
![]()
NAMEFile::Locate - Search the (s)locate-database from Perl SYNOPSISuse File::Locate; print join "\n", locate "mp3", "/usr/var/locatedb"; # or only test of something is in the database if (locate("mp3", "/usr/var/locatedb")) { print "yep...sort of mp3 there"; } # do regex search print join "\n", locate "^/usr", -rex => 1, "/usr/var/locatedb"; ABSTRACTSearch the (s)locate-database from Perl DESCRIPTIONFile::Locate provides the locate() function that scans the locate database for a given substring or POSIX regular expression. The module can handle both plain old locate databases as well as the more hip slocate format. FUNCTIONSThe module exports exactly one function.
EXPORTlocate() is exported by default. If you don't want that, then pull in the module like that: use File::Locate (); You have to call the function fully qualified in this case: File::Locate::locate(). SEE ALSOThe manpages of your locate(1L)/slocate(1L) program if available. AUTHORTassilo von Parseval <tassilo.von.parseval@rwth-aachen.de> COPYRIGHT AND LICENSECopyright 2003-2007 by Tassilo von Parseval This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
|