in reply to Re: how to post an xml using REST::Client
in thread how to post an xml using REST::Client

my %fields = ( deliverable_file => "@sample.xml",
This will attempt to interpolate the string since it is in double quotes. If you really have a file called @sample.xml (which seems like an unfortunate choice of filename), you should quote it with single quotes so Perl doesn't try to replace @sample with the contents of a non-existent array.

Other errors with this code:

$ perl -c 1159843.pl Possible unintended interpolation of @sample in string at 1159843.pl l +ine 11. Global symbol "@sample" requires explicit package name at 1159843.pl l +ine 11. Global symbol "$host" requires explicit package name at 1159843.pl lin +e 21. Bareword "tags" not allowed while "strict subs" in use at 1159843.pl l +ine 10. 1159843.pl had compilation errors.

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^3: how to post an xml using REST::Client
by KSHYAMKUMAR (Acolyte) on Apr 08, 2016 at 20:15 UTC

    Hi 1nickt,

    My filename is sample.xml, since the curl command has downloadable_file as @sample.xml, it was formatted like that by the previous Perl monks user who responded to my post. if i specify the downloadable_file => 'sample.xml', does it transfer the file RESTfully to the destination.

      I can't tell if your last sentence is a statement or a question, but either way you should begin with a *new* simple script that attempts to use the module you have chosen, to do its most simple task. Forget all about your data and just try to write a script that will POST a very simplified, generic request to a server. Then go from there.


      The way forward always starts with a minimal test.