A litle affectation question in Perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dnux67
    New Member
    • Nov 2006
    • 1

    A litle affectation question in Perl

    How could I affect the system function return value to a scalar?

    Like if i do this

    $folder="/home/user/data"
    system "du -s $folder" # How could i get this return value into a scalar


    Thank you for your answer.

    S
  • GunnarH
    New Member
    • Nov 2006
    • 83

    #2
    Originally posted by dnux67
    How could I affect the system function return value to a scalar?
    You can't. Use backticks (or the qx operator) instead.

    Comment

    • miller
      Recognized Expert Top Contributor
      • Oct 2006
      • 1086

      #3
      Originally posted by dnux67
      How could I affect the system function return value to a scalar?
      Next time, just read the documentation:



      It talks in detail about what you want, and the way to acheive it doing as GunnerH says.

      Comment

      Working...