in reply to how to get cmd prompt output

system returns the exit status of the external program, which is not what you are after. To capture the output of the external proram, there are a few options.

The simplest is to use backticks, for example:

chomp(my $hostname = `/bin/hostname`); # Note that the chomp is necessary to remove the trailing newline

Another option is to open a piped filehandle, eg:

my $cmd = '/bin/hostname'; open (IN, "$cmd|"); chomp(my $hostname = <IN>);

But neither of the above methods are portable. So as usual, CPAN is your friend. Take a look at Sys::Hostname.

Cheers,
Darren :)