Use Kernel's local_variables method
$ship = "P" @friend_1 = "M" @friend_2 = "J" bad_chap = "G" p local_variables