We propose and demonstrate a fiber-based phase-only filtering technique for programmable optical pulse shaping, in which the filtering operation is implemented in the time domain by means of an electro-optical (EO) phase modulator. The technique has been applied for generating customized ultrahigh-repetition-rate optical pulse sequences (>40 GHz) from single input pulses by driving the EO phase modulator with a periodic electronic waveform (RF tone). The generated output pulses are replicas of the input pulse and both the repetition rate and the envelope profile of the generated sequences can be controlled and tuned electronically using this approach.