Can you explain further what is required.
here i give u the code to get data from command line.
#!/usr/bin/perl --
print "Enter The Key\n";
my $key = <STDIN>;
chomp($key);
print "You have entered $key ";
To execute anything to a application or services in system you can use system command.
system "ps -C $var";
|