paulsm4 10x for trying to help me again and for your suggestion.
btw, I found the answers for this problem
It was first that 'tc' program was returning into STDERR ( 2> ) and that's why I coulnd correct implement my algoritham and see the output from 'tc'.
After that it was that it didn't had permissions for setting changes when run 'tc' by apache user.
if s.b. is interested the solution of the problem is:
1) add into /etc/sudoers:
apache <name_of_local_machine>=NOPASSWD: /sbin/tc
2) into the perl script use something like this:
$error = `sudo /sbin/tc <arguments> 2>&1`
print $error if $error;
hope I've helped