This means that $gpioLevel is the empty string ('') in the error case .....
I fear you have to bite the bullet and debug, how this variable gets its value. My guess is that @getCmd doesn't contain what you expect (maybe it has one extra line in the beginning?), so I would first dump this variable:
use Data::Dumper qw(Dumper);
....
print $q1->h4(Dumper(\@getCmd));