jdorwin has asked for the wisdom of the Perl Monks concerning the following question:
Howdy
Expected output is a bearer token that looks kind of like 49vh29378bhwbejgmhm95.
This worked yesterday, but I guess I touched it wrong and now it gives me "Use of uninitialized value in print at ./rough.pl line 93." Line 93 is the line that has print getToken(); on it. The command between the ticks (``) works in my terminal, and returns the JSON output with a token in it. I can't seem to figure out why I'm getting this error. Am I missing something?
Any help is greatly appreciated!sub getToken # generates Bearer access token { my $output = `curl -k -s -XPOST (URL) -dgrant_type=password -dclie +nt_id=(client ID) -dclient_secret=(client secret) -dusername=(usernam +e) -dpassword=(password)`; $output =~ /"access_token":"(.*)", "ex/g; return $1; } print getToken();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why is this an uninitialized value?
by Corion (Patriarch) on Jun 29, 2018 at 15:01 UTC | |
|
Re: why is this an uninitialized value?
by stevieb (Canon) on Jun 29, 2018 at 15:04 UTC | |
|
Re: why is this an uninitialized value?
by davido (Cardinal) on Jun 29, 2018 at 17:25 UTC | |
by locked_user sundialsvc4 (Abbot) on Jun 29, 2018 at 18:34 UTC | |
by Anonymous Monk on Jul 01, 2018 at 19:54 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |