Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That file is very different with an added rewind and now case/when.

    dirp = Dir.open(".")
    dirp.rewind
    for f in dirp
      if (~/^\./ || ~/~$/ || ~/\.o/)
      else
        print(f, "\n")
      end
    end
    dirp.close


   if (~/^\./ || ~/~$/ || ~/\.o/)
ah, the perl heritage is strong here!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: