... as haukex said or hack your way around it:
... warn( "Put failed: @{[$sftp->error]} \n" ) ...
Update to response below:
The @{ ... } dereferences an array-ref. By default, the resulting string
is a space separated (see $" in perlvar) concatenation of the array elements.
However, $sftp->error() returns a scalar (string). Here, the square brackets
come into play. They generate an anonymous array - with one single element - that finally is dereferenced and interpolated.
It's somewhat equivalent to: warn( "Put failed: " . join($", @{ [ $sftp->error() ] }) . " \n" );