in reply to Can't modify non-lvalue subroutine call in chomp

What you want is to chomp the scalar, not the return value: chomp(my $credentials = encode_base64("peip:930612")); As usual, this is untested, etc.