Modernize the code a bit:
   use re module
   make chomp() use rstrip()
1 file changed