Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: storing system function output

by karthigayan (Initiate)
on Mar 10, 2010 at 09:55 UTC ( #827739=note: print w/ replies, xml ) Need Help??


in reply to Re: storing system function output
in thread storing system function output

I know that , but I just wanna know is there any way to achieve this using system function , please answer specifically!


Comment on Re^2: storing system function output
Re^3: storing system function output
by BrowserUk (Pope) on Mar 10, 2010 at 10:02 UTC
    is there any way to achieve this using system function, please answer specifically!

    No.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Well, I believe this is not entirely true. You might capture the stuff if you fiddled with STDOUT and STDERR enough, but it would not be nice. And it's totally unnecessary. So I think the precise answer is "You could, but it would not be pretty so you should not. Use the tools that were designed to do that!"

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

        But that wouldn't, specifically, be using the system function. It would be using "the system function plus a lot of other stuff". Otherwise known as backticks or qx//, which had already been specifically rejected.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: storing system function output
by tirwhan (Abbot) on Mar 10, 2010 at 10:14 UTC

    So after being told that system is not the right way to do this you still insist that it's what you want to use. And "specifically", too. Fine, here you go:

    #!/usr/bin/perl use strict; use warnings; my $r=`perl -e 'system("ls")'`;

    That uses system and will make your tutor give you 0 points for the exercise along the way.


    All dogma is stupid.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://827739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-08-23 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls