You know those TV specials of some war-torn area that make you happy for your tiny little 1br studio? Well, maybe one look at this code will make you happy with whatever Perl challenges you have to deal with:
Logging::logDebugMessage( $moduleArea, $feedName, $routineName, $moduleAreaCode, "Entering $routineName.", $Logging::PRIORITY_DIAGNOSTIC ); # check if the directories are equal chdir( $fromDir ); @fromDir = `pwd`; chdir( $toDir ); @toDir = `pwd`; if ( @fromDir eq @toDir ) { Logging::logErrorMessage( $moduleArea, $feedName, $routineName, $errorString . "00", "FromDir is the same as ToDir. Unable to copy data +files." , $Logging::PRIORITY_CRITICAL );
  • Comment on For your entertainment (or mourning... depending on how you look at it)
  • Download Code

Replies are listed 'Best First'.
Uhm, Caller?
by tedv (Pilgrim) on Nov 23, 2000 at 03:30 UTC
    Ugh, didn't the code author know about the caller() function? You don't need to pass all that crap into the function when you can extract it from the call stack.

    I think my favorite part is when they don't check return calls from chdir, but check the return from 'pwd' by using eq on two lists. Man, that's hilarious. Heaven only knows what directory the outside code thinks you'll be in afterwards. Could someone slap these guys with the -d, -w, and -r test flags?

    -Ted