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

Is it your intention to assign the length of whatever gets chomped (usually '\n') to $credentials? chomp's return value is the length of whatever got chomped, not the input-string minus the chomped bit.

chomp acts upon its parameter list, and in your case, is trying to modify the non-lvalue sub.

Update: chomp returns length of chomped portion, not the chomped portion itself.

Dave

  • Comment on Re: Can't modify non-lvalue subroutine call in chomp