So let's think this through.
- "select a file from the command prompt"
I'm not familiar with any form of "command prompt" -- familiarity being limited to RT-11, cpm, windoze & *nix -- that allows anyone to "select" anything. So I guess that means I'm not really going to be able to satisfy the "command prompt" part of your spec... or else that "command prompt" means something I don't understand... or else that "command prompt" means something other than what you appear to believe.
- "user to be able to use commands like CD"
Well, you could spawn a new CLI with backticks (neither exec nor system will work for what appears to be your purpose) and let the user play, but that's not really a terribly secure idea, even if you're writing a program for installation on the user's own machine. So, 'fergeddaboudit'!
- "wanna stor the result in a string"
Yeah, that would be really cool... but if you want to do that, you probably better build a webpage, a couple scripts to (1) deal with the form you're going to put in the html and (2) to do the work to achieve whatever your ultimate (and un-articulated) goal may be
...or
step onto the learning curve for building a gui (It may be worthwhile to read perldoc Tk).
Bottom lines: