You're using the wrong sigil, using an inapropriate comment marker, and providing nothing to prompt the user to enter a value. And that's just for starters.
This looks like homework, by someone who hasn't bothered to study the text being used for the class. Please do so, and if it suggests something like this, then study Learning Perl.
we expect SOPW to seek wisdom, not to ask us to do so for them.
Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
- code
- verbatim error and/or warning messages
- a coherent explanation of what "doesn't work actually means.