Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I use strict with asub( a = 'b' ) syntax?
by merlyn (Sage) on Mar 15, 2001 at 19:44 UTC | |
|
(ar0n) Re: How do I use strict with sub( a = 'b' ) syntax?
by ar0n (Priest) on Mar 15, 2001 at 18:58 UTC | |
|
Re: How do I use strict with asub( a = 'b' ) syntax?
by davorg (Chancellor) on Mar 15, 2001 at 19:00 UTC | |
by tye (Sage) on Mar 15, 2001 at 19:59 UTC | |
|
Re: How do I use strict with asub( a = 'b' ) syntax?
by Anonymous Monk on Mar 16, 2001 at 14:05 UTC | |
by iakobski (Pilgrim) on Mar 16, 2001 at 15:46 UTC | |
|
Re: How do I use strict with asub( a = 'b' ) syntax?
by Jouke (Curate) on Mar 15, 2001 at 19:06 UTC |