in reply to Problem in posting using LWP::UserAgent

Note that you have an open in your program whose return value you don't check. Perhaps the open failed, who knows?
file => "@data"
Are you sure you want this? You do know this introduces a space at the beginning of each line, except the first line, don't you?

Abigail