in reply to checking the end of line

Rather than just blindly giving you an answer or accuse you of cheating on homework, I will try to explain what your code is doing. That way you can fix it yourself and maybe learn something in the process.
$path = hiec/by/mlor/kkss23/dndd@@mani/css.cpp/0
You are trying to assign a string to a variable. This won't work without quotes and a trailing semicolon. It is also a very good habit to add use strict; at the beginning of your program an use my on all of your variables. This is not required but it will save you a lot of headaches in the long run.
$path =~ (m/\d+$\/);
I think you have a typo. What you are doing is looking for digits followed by the value of the $\ special variable ($\ is the $OUTPUT_RECORD_SEPARATOR). I don't think this is what you want. I will take the liberty of changing the typo to what I think you want.
$path =~ (m/\d+$/);
Hmmmm. This line does essentially nothing. You are checking if there are numbers at the end of the string stored in $path. But you are not using the return value to see if the match succeeded and you are not capturing anything in the regexp. A simple match does not alter the string either. If you want to capture the digits you will have to add parentheses arround the \d+. If you want to change $path use a search/replace ( s/// ) operator. But be carefull. If you do something like a $path =~ s/.*?(\d+)$/$1/; and $path doe not end in digits $path will not be changed. Since you are doing a numeric compare below, the number that will be used will be the digits at the start of $path!

Here is the way I would do it.

use strict; my $path = 'hiec/by/mlor/kkss23/dndd@@mani/css.cpp/0'; if ($path =~ m/(\d+)$/ and $1 == 0) { # ends in zero } else{ # not zero or no digits }
What I do is check if $path ends in digits. If it does not, the compare on the right side of the and never is executed and the if statement fails so control goes to the else block. If $path ends in digits then the digits are captured into $1 due to the parentheses. $1 is compared to zero. If it is zero the first block is executed. If not then the else block is executed.

OK, so I gave you code. I hope you understand it. If you do and are getting help on homework then all the better. Understanding Perl is what the homework is all about.