Perfect sets and f-ideals