in reply to checking the end of line
if ($path == 0)
Remember, you said $path was: 'hiec/by/mlor/kkss23/dndd@@mani/css.cpp/0'.
Try something like this:
if($path =~ /(\d+)$/ == 0) {} else {}
Note that what you used never captured the resulting match (that is, it was used in void context and had not side effects). Using the parentheses like I do, it sets the $1 variable (see perlre) -- note, too, that it also returns the value which I check, so you can say something like $my_value = ...regex_here...
In Section
Seekers of Perl Wisdom