in reply to getting the output of command in variable

phemal

Use the $x = `cmd`; form to get the results of the command into the variable.

The $x = system "$cmd"; form executes the command in $cmd, and puts the result code into $x.

Also, don't put a space inside your code tag--it's difficult to read your post.

--roboticus Update: Clarified second statement.