in reply to Need to display output from shell

First - please change o/p to output in your title (I assume that's what it stands for) - otherwise you're making people read your entire post to understand the subject.

Second - you are already doing it right, if I understand what you want to do. eg:

#!/usr/bin/perl -w use strict; system("echo foo");
will print foo to the screen.

There are basically three ways to run system commands (there's a lot more, but for now these will do:

#!/usr/bin/perl -w use strict; my $res = system("/sys/command");
The standard out of the command will be printed to the screen and the perl variable $res is the return value of the command (ie. 0 for successful execution).

The other way is with backticks which are the backwards apostraphes on your keyboard. eg:

#!/usr/bin/perl -w use strict; my $res = `/sys/command`;
Thi this case, nothing is printed to your screen and the perl variable $res is set to the entire standard out of your command.

The third way is to treat it like a file pipe - this way is best for a lot of output:

#!/usr/bin/perl -w use strict; my $file_handle; open $file_handle, "/sys/command |" or die "unable to open command as +pipe"; while my $line = ( <$file_handle> ) { chomp $line; # remove new line do_something( $line ); }
Which way is best depends on what you're trying to achieve.