perlsub explains this with examples.
Update: also tutorials->Subroutines.
In reply to Re: subroutine For ssh by marto in thread subroutine For ssh by GHMON