in reply to What is wrong with this code?

Change:
if ($type eq 'square' or 'Square'){
to:
if ( ($type eq 'square') or ($type eq 'Square') ){
This is a precedence issue (see perlop). Since 'Square' is always true, you always get a square.

You need to do this for your other shapes as well.

Another common way to be case-insensitive is to use lc:

if (lc($type) eq 'square'){
One difference from your code is that this will also accept 'sQUaRe', etc.

See also use strict and warnings.