How can I store Perl's system function output to a variable?

Posted by karthi-27 on Stack Overflow See other posts from Stack Overflow or by karthi-27
Published on 2010-03-10T10:04:41Z Indexed on 2010/03/28 19:03 UTC
Read the original article Hit count: 316

Filed under:
|

I have a problem with the system function. I want to store the system functions output to a variable.

For example,

system("ls");

Here I want all the file names in the current directory to store in a variable. I know that I can do this by redirecting the output into a file and read from that and store that to a variable. But I want a efficient way than that. Is there any way .

© Stack Overflow or respective owner

Related posts about perl

Related posts about system