Advertisement
Guest User

gee, it fukn works! :D

a guest
Mar 4th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.29 KB | None | 0 0
  1. >> def each_file n
  2. >>   n.each do
  3. ?>       |name|
  4. ?>       yield File.open name, 'r'
  5. >>     end
  6. >>   end
  7. => nil
  8. >> f
  9. => ["d2", "d3"]
  10. >> each_file f do
  11. ?>     |file|
  12. ?>     file.each do
  13. ?>       |line|
  14. ?>       puts line
  15. >>     end
  16. >>   end
  17. x
  18. xx
  19. yy
  20. yyyyyy
  21. => ["d2", "d3"]
  22. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement