in reply to Re^16: how to print out windows service status
in thread how to print out windows service status

#while (@services) for (@services){
poj

Replies are listed 'Best First'.
Re^18: how to print out windows service status
by ytjPerl (Scribe) on Aug 03, 2017 at 19:17 UTC
    what is the difference here?
      while (@services) repeats the loop while the array isn't empty. It doesn't assign any element to any variable, and as you don't change the array in the loop, it runs forever.

      for (@services) assings elemnts of @services to the implicit variable $_, one by one. After looping over all the elements (each element once), it stops.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,