in reply to Trying to split on '?'

The expressions you use in split (unlike join) are regex's. '?' is a special character (zero or one) in a regex. You will need to escape '?' with a '\' (Ex. "\?").

You should use -w or use warnings because what you did would have shown up as the warning

Quantifier follows nothing before HERE mark in regex m/? << HERE


grep
Unix - where you can throw the manual on the keyboard and get a command