Why not wrap these commands in a subroutine?
In reply to Re: Selenium waitForXXXX in Perl by Corion in thread Selenium waitForXXXX in Perl by BourneID