PERL - Switch output to Variable (String) : I started to programming with Perl and have a problem to put the Output from a Switch (Cisco) in a variable.

Example:

I want to send the Command show version to the Switch ($easy->send_command("show version");
and then put the Response from switch in a String (not in a other File)

After then i will search in the string to compare versions (i declare at begin a string (this ist the other variable for comparing) for Example $version = "bootflash:cat4500-ipbasek9-mz.122-50.SG2.bin";)

At the moment i don't now how i can put the Output from the Switch in a String after i send the command Show version to them.

Can anyone help me?