"Again, we may put all this together to conclude that our program outputs a boolean value if supplied with an integer input. However, it is important to realise that the presence of $p$ is absolutely essential for the inference to happen. For example, our program might well satisfy $p → q$, but if it doesn’t satisfy $p$ – e.g. if its input is a surname – then we will not be able to derive $q$."
This is text from the book Logic in Computer Science by M. Huth and M. Ryan (page 9).
The second line in the paragraph necessiates the need for p being true, however, the truth table of Implication mentions one case where p is false, but q is true, and the resultant implication is true. How could that be when p is false?