Bubble sorting with Perl
#!/usr/bin/perl use strict; use Data::Dumper; sub swap{ @_[ 0, 1 ] = @_[ 1, 0 ]; } sub bsort{ my (@a) = @_; for my $j (0 .. $#a){ for my $i (0 .. $#a – 1 – $j ){ … Read more
#!/usr/bin/perl use strict; use Data::Dumper; sub swap{ @_[ 0, 1 ] = @_[ 1, 0 ]; } sub bsort{ my (@a) = @_; for my $j (0 .. $#a){ for my $i (0 .. $#a – 1 – $j ){ … Read more
$stopingServices=Get-Service | Where-Object {$_.status -eq “stoping”} $startingServices=Get-Service | Where-Object {$_.status -eq “starting”} $runningServices=Get-Service | Where-Object {$_.status -eq “running”} $stoppedServices=Get-Service | Where-Object {$_.status -eq “stopped”} if($startingServices){ Write-Host “`nStarting Services: $startingServices” } if($stopingServices){ Write-Host “`nStoping Services: $stopingServices” } if($runningServices){ Write-Host “`nRunning Services: $runningServices” } if($stoppedServices){ Write-Host “`nStopped Services: $stoppedServices” }