Alyson Hannigan taught Jason Segel ''how to be a man.''

The 'How I Met Your Mother' actor, who reportedly checked into rehab following his split from Michelle Williams last February, admitted he is really going to miss his co-star when the show finishes up in March after nine seasons.

The 34-year-old star told US chat show 'The Talk': ''Aly taught me a lot about how to be a man, I gotta say. I was 25 when I took the show.

''I think we've all been through a lot personally. Aly and I have a lot of scenes together, spend a lot of time together, and she's always been there to listen to me and give me advice. [She] saw me through hard times and good times.''

He added: ''I learned a lot from being around Alyson about the kind of person that I wanted to be.''

Jason appeared on the talk show with his castmates, including Neil Patrick Harris and Alyson, who broke down in tears when asked what she is going to miss about Jason.

The 39-year-old actress, who has two daughters, Satyana, four, and 20-month-old Keeva, with her husband, Alexis Denisof, said: ''He's just such a wonderful guy . . . I'm getting all . . . I'm not gonna miss him. I'm not good at answering this question at all.''