Help for this page

Select Code to Download


  1. or download this
    opendir DH, $dir_to_process
    # Use a lexical ($dir) instead of a bareword global (DH) if possible
    
  2. or download this
    if ($file =~ /\.txt$/) 
    # This would break for a directory called dir.txt - see perldoc -f -X
    
  3. or download this
    %stuff_to_store = ($dir_to_process, $file);
    # This overwrites the hash entirely every time
    
  4. or download this
    while (%stuff_to_store) {
    # this will be an infinite loop if the hash contains any items