in reply to Killing processes

Backticks call a shell command and return its output. system just runs a command, letting its output go to the standard output. But you combined them into
system `kill $pid`;

So, backticks call kill. Kill doesn't return anything on the standard output, so system gets called with an empty string as the argument. Remove the backquotes and just call system:

my $status = system 'kill', $pid;

Update: Or, even better, use kill:

kill $pid;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Killing processes
by deyaneria (Acolyte) on Mar 20, 2015 at 16:19 UTC
    so it's basically like i'm telling it to do it twice:) Thanks you guys pick up on stuff my teacher misses, he couldn't find anything wrong with it.

      My 2˘ - a very basic kata, featuring the usage of kill:

      karls-mac-mini:monks karl$ perl -e 'print $$;sleep;' & [1] 434 karls-mac-mini:monks karl$ jobs [1]+ Running perl -e 'print $$;sleep;' & karls-mac-mini:monks karl$ ps aux | grep [p]erl karl 434 0,0 0,0 2440564 2148 s000 S 7:20pm 0: +00.01 perl -e print $$;sleep; karls-mac-mini:monks karl$ perl -e 'print kill q(TERM), 434;' 1[1]+ Terminated: 15 perl -e 'print $$;sleep;' karls-mac-mini:monks karl$ jobs karls-mac-mini:monks karl$ ps aux | grep [p]erl karls-mac-mini:monks karl$

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»