in reply to Memory Question

Would it just be easier to use unix commands to do this? find, sort, grep ... those were unix commands before they were co-opted as Perl keywords. To me, this sounds like a job for the shell, not Perl.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: Memory Question
by l2kashe (Deacon) on Feb 21, 2003 at 20:03 UTC
    While this could be done in the shell, I have found personnally that Perl get things done slightly faster and cleaner than spawning massive chains of shell commands. Its also easier to collect all the info and compare / process it in perl than with shell utils, but then again I am not shell guru by any means.

    Someone pointed out File::Find which will get you rolling, and will be slightly kinder on your system than a 'find' would be. Also there are some decent chapters in the panther book (Advanced Perl Programming) that deal with efficiently comparing 2 hashes, and pulling out the differences between them.

    Best of luck

    /* And the Creator, against his better judgement, wrote man.c */
      While I LOVE Perl, I disagree in this case.

      If the only thing needing to be checked is permissions, the following would suffice:

      find / -exec ls -l {} \; > /tmp/pass1 find / -exec ls -l {} \; > /tmp/pass2 diff /tmp/pass1 /tmp/pass2
      Of course you would tailor the find command as PrimeLord indicated (only get specific files with permissions).

      In my experience, this specific task is faster/easier/efficient using Unix commands.

      Cheers - L~R