I suspect that it's due to the fact that $output doesn't contain what you think it does, and the return ($1) is uninitialized.
Better to check for this condition (untested):
sub getToken { my $output = `curl -k -s -XPOST (URL) -dgrant_type=password -dclie +nt_id=(client ID) -dclient_secret=(client secret) -dusername=(usernam +e) -dpassword=(password)`; if ($output =~ /"access_token":"(.*)", "ex/g){ return $1; } else { die "output not as expected...\n"; } }
In reply to Re: why is this an uninitialized value?
by stevieb
in thread why is this an uninitialized value?
by jdorwin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |