pieflag compares bandpass-calibrated data to a clean reference channel and identifies and flags essentially all bad data. pieflag compares visibility amplitudes in each frequency channel to a 'reference' channel that is rfi-free (or manually ensured to be rfi-free). pieflag performs this comparison independently for each correlation on each baseline, but will flag all correlations if threshold conditions are met. To operate effectively, pieflag must be supplied with bandpass-calibrated data. pieflag has two core modes of operation (static and dynamic flagging) with an additional extend mode; the type of data largely determines which mode to choose. Instructions for pre-processing data and selecting the mode of operation are provided in the help file. Once pre-processing and selecting the mode of operation are done, pieflag should work well 'out of the box' with its default parameters.