Kernel's method global_variables returns all the global variables, including $ship.
$ship = "P" @friend_1 = "M" @friend_2 = "J" bad_chap = "G" p global_variables