It was working, then I put use strict at the top and found a few potential problems. These I fixed, but managed to completely break the program.
Here's my working function:
Now if I put use strict at the top it complains that bareword content is not allowed with strict subs. If I then change the offending line touse LWP::UserAgent; use HTTP::Request::Common; use URI; sub CreatePriorityAccount{ my $query = shift; my $url = new URI(); $url->scheme( 'http' ); $url->host( getLotusServer() ); $url->path_query( LOTUSPRIPATH ); my $res = $ua->request(POST $url, content-type => 'form-data', content => $query, authorization => "Basic " . AUTHORISATION, ); # Get the Notes DocID from the response if ($res->is_success) { my ( $DocID ) = $res->content =~ /The DocID for this event is +([0-9A-F]*)/; LOG "SUCCESS: $name, Doc ID is $DocID"; StoreDocID( $name, $DocID ); } else{ LOG "FAILED: POST $url"; LOG "RESPONSE: ", $res->code, ": ", $res->message; } }
It appears to work, but the content does not get passed to the server!'content-type' => 'form-data',
I know I can put no strict 'subs' in a block around the call, but I would rather understand what is going on here and do it properly.
Thanks for your wisdom.
2001-03-15 Edit by Corion: Removed CODE tags (or rather, their remnants) from the node title.
In reply to How do I use strict with asub( a = 'b' ) syntax? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |