Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Searching a file and then opening it

by prasadbabu (Prior)
on Nov 07, 2006 at 06:46 UTC ( [id://582580]=note: print w/replies, xml ) Need Help??


in reply to Searching a file and then opening it

You have to take a look at stat, opendir, open and File::Find::Rule. By using those mentioned functions and module, you can achieve your target. As planetscape++ said, you have to try to write the code and post the code if you have any problem. Below is a sample code.

use strict; use warnings; use File::Find::Rule; my ($filename, $giventime, $directoryname); my @files = File::Find::Rule->file() ->name( "$filename" ) ->ctime ("< $giventime") ->in( "$directoryname" ); for my $file (@files) { open ($fh, '<', $file) or die ("$!"); }

update: Added code

Prasad

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://582580]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-25 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found