in reply to Re^3: File::Find and replacing spaces in filenames.
in thread File::Find and replacing spaces in filenames.

Thank you, now I get!

Could you please tell why performing second match is bad? It can cause some errors? Or it spends resources of the machine? Or is it just a bad style of programming?
  • Comment on Re^4: File::Find and replacing spaces in filenames.

Replies are listed 'Best First'.
Re^5: File::Find and replacing spaces in filenames.
by 7stud (Deacon) on Dec 23, 2012 at 03:29 UTC

    Because it's unnecessary. Why would you want to perform operations in your code that weren't necessary? Would you write a hello world program like this:

    use strict; use warnings; use 5.012; if ("hello world" =~ /hello/) { print 'hello'; } if ("hello world" =~ /world/) { print " world\n"; } --output:-- hello world

    That program unnecessarily uses program resources, and therefore it is bad programming style.