In a sense, you can't, since most variables are declared using
my which makes them lexical. You can't just open up the symbol table and poke around looking for them in the same way you can for subroutines. Of course, this is presuming you're not using something like
our or
use vars to declare variables.
Usually, you're curious about the value of a particular variable, or even a group of them, which is where a tool like
Data::Dumper can come in handy. In the formatted mode, where you label your variables, it can be rather informative.
Of course, I'm only touching the surface here. There's probably a way to do it if you're really determined.