You are right that variable declarations aren't needed to distinguish integer/float/... types like in C.
I think of perl variable declarations not as memory allocation instructions, more as namespace instructions specifying when $name is valid. Memory will be allocated/freed as needed by the interpreter. Building a really long string in $name will cause more memory to be allocated for it.
Declaring a variable with "my $var" makes it local to the current scope. Without the "my" declaration, it is a global variable. Usually subroutines should declare any variables they use with "my" to avoid polluting the global namespace. For more background read the perlsub documentation.
Where the variable is declared can have performance implications since it may cause the variable to be destroyed/re-created, as discussed here.