karthigayan has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks ,
I have a doubt in 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 . Thanks in advance .
I have a doubt in system function.I want to store the system functions output to a variable.
For example,
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 . Thanks in advance .
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: storing system function output
by Ratazong (Monsignor) on Mar 10, 2010 at 09:50 UTC | |
| |
Re: storing system function output
by marto (Cardinal) on Mar 10, 2010 at 09:57 UTC | |
Re: storing system function output
by wwe (Friar) on Mar 10, 2010 at 16:13 UTC | |
Re: storing system function output
by doug (Pilgrim) on Mar 12, 2010 at 14:58 UTC |
Back to
Seekers of Perl Wisdom