in reply to html && OS variables
"...alternatives..."
Avoiding to shell out might be one:
#!/usr/bin/env perl # $Id: procs.pl,v 1.2 2017/08/02 07:39:39 karl Exp karl $ # http://perlmonks.org/?node_id=1196387 use strict; use warnings; use feature qw(say ); use Proc::ProcessTable; use Data::Dump; my $cmndline = qr(syslog); my @processes = @{ Proc::ProcessTable->new->table }; for my $process (@processes) { say $process->cmndline; } # dd \@processes; my $found = grep { $_->cmndline =~ /$cmndline/ } @processes; say $found; __END__
See also Proc::ProcessTable.
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
|
|---|