Manuel Pellegrini praised the impact of Lucas Perez after the substitute came off the bench to bag a brace as West Ham beat Cardiff 3-1.