Remove use of smartmatch operator which triggers a warning on Perl >= 5.18

The replacement code differs slightly from ~~ in that it treats undefined
and empty strings as equivalent.  However it doesn't look like empty
strings could ever occur in this code since if a fragment was present it
would always start with a '#'.

It seems we lack test coverage since every time this code is executed by
the test suite, both values are undefined.