Purchase Solution

Perl find: locating single file or multiple files

Not what you're looking for?

Ask Custom Question

Please help with the following programming problem.

I always use the following find command in Unix to locate one or several files:

find / -name filename -type f 2>errormessage

The Unix find command is very slow. It takes lot of time to get the required results. I was told Perl has one of the best find command.

Please provide me the find command for Perl. How to use it? How the result will be displayed? Using the command I should be able to locate a single file or multiple files.

Purchase this Solution

Solution Summary

This solution helps with a problem regarding the programming language, Perl.

Solution Preview

An example implementation is given below. You can refer to the following link: http://search.cpan.org/~lbrocard/perl5.005_04/lib/File/Find.pm for more details on find facility of Perl.

----------------------------------------------------------------
#!/usr/bin/perl

use File::Find;

sub search_a_file {
/^hello.txt$/ && print $File::Find::name . "n";
}

sub search_many_files {
/.txt$/ && print $File::Find::name . ...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.