in reply to Re: Searching Sub Dir for Files
in thread Searching Sub Dir for Files

File:Find is a module. Im running this on a Unix server and do not have SA permissions and do not want to install any modules on the server. I basically have 2 options 1) Install the module on my pc and run it from my pc to do this (Would this work if I have to telnet into the Unix box)? 2) Write my script to do what File:Find would do? Any suggestions? Thanks again everyone... Fue

Replies are listed 'Best First'.
Re^3: Searching Sub Dir for Files
by davidrw (Prior) on Jun 01, 2005 at 19:21 UTC
    Is installing it locally (like in /home/yourname/local) an option?
    1) is not an option--if it's running on the server, it can't read your modules from your pc.
    2) you can, but it will take time, and not be as robust as the hardened and proven File::Find module.

    You can always look at File::Find's source, but i would strongly recommend using the module itself (are you sure it's not installed already?). If you're going to write it yourself, i'm sure you can find a recursion example of doing just this...

    A workaround would be to use unix tools .. construct a commandline w/somthing like (i'm sure you'll want to tweak the egrep settings):
    my $cmd = 'find /some/path -name \*.sas | egrep -l ' . "'(" . join(' +|',@words) . ")'";
      Well our Unix box has the bare minimum when it comes to perl... no modules installed. I cant install it on the unix box. As for #1, lets say if I install it on my PC using ppm, and use the Telnet Module to telnet over and use File:Find to search directories, would that work? Pao
        no, it can't work -- if File::Find is on your pc, it can only be executed on your pc and so will only find your files, not the servers...

        "no modules installed" ... are you _sure_?? you really have just /usr/local/bin/perl and _nothing_ else? doing locate perl and locate .pm brings up _nothing_? (is this a system where everything has to be tiny? why isn't here a normal perl install?)

        just for kicks, try doing perl -MFile::Find -e 1 on the command line and see if you get an error or not.