 Perry and Doofenshmirtz at first seem to <unk> each other in the beginning of the series , and have been arch @-@ <unk> since the day they met . However , they are often <unk> and friendly towards one another and it is said by Doofenshmirtz that Perry is his best friend , and Perry will often act to save Doofenshmirtz 's life when his plot inevitably blows up in his face . <unk> , their daily <unk> involve Doofenshmirtz <unk> a scheme , which Perry goes to stop after being briefed by Major Monogram . He is trapped by Doofenshmirtz while trying to do so and is told of the doctor 's scheme , usually pertaining to some backstory or pet <unk> . He then escapes and the two fight , Perry coming out victorious . The two rely on this daily structure , Doofenshmirtz even specifically mentioning it in " Journey to the Center of Candace " and in episodes such as " It 's About Time ! " in which Doofenshmirtz temporarily replaces Perry with secret agent Peter The <unk> and they become depressed about not having each other to fight . Perry realizes he misses <unk> too . When Perry does not arrive on the scene of Doofenshmirtz 's evil plan , the doctor hesitates to execute his plans and fears for where Perry has gone , though he notes that he " hopes something terrible has happened to him . " . Sometimes , they decided not to fight and have fun , as shown in " Happy New Year ! " and " Candace <unk> " . On other occasions , depending on whatever situation Doofenshmirtz is facing , Perry would often help Doofenshmirtz with his non @-@ evil plans , such as helping him overcome evil scientist 's block , helping him put on a birthday party for his 16 @-@ year @-@ old daughter Vanessa , impressing a square dancing girl with programmable square dancing boots that <unk> created , working together to stop a <unk> platypus hunter from hunting them down , or helping him convince his rich ex @-@ wife to help pay off his <unk> debt . Also , Perry tends to use Doofenshmirtz 's inventions to erase evidence of whatever contraptions Phineas and Ferb had made , leaving Candace unable to bust them . Examples include when Perry asked to borrow Doofenshmirtz 's robot <unk> to pick up footage from the city surveillance cameras in order to preserve his job as an agent , as well as using Doofenshmirtz 's Pick @-@ Him @-@ Up @-@ <unk> to rescue a lost Candace and bring her home . 
