in reply to regex problem

The regex needs to be anchored to the start of a line and followed by a word break. The conditional part also needs to account for lines that do not begin with 'If' at all.
#! /usr/bin/perl -w use strict; use warnings; while (<DATA>) { if (/^If(f?)\b/) { if ($1) { print "found Iff\n"; } else { print "found If\n"; } } else { print "no If\n"; } } __DATA__ If and only iff Iff this were the end the end last If Iffy code or what