You may have the interpolation occurring in a block that is evaluated only in debug mode: def debug_print( &a_block ) if $DEBUG print a_block.call() end end # Then use: # debug_print{"Hello"} # instead of # debug_print("Hello") # .