Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ->shorten() returning hash rather than string in commandline app #3

Open
bpj opened this issue Nov 23, 2018 · 0 comments
Open

Fix ->shorten() returning hash rather than string in commandline app #3

bpj opened this issue Nov 23, 2018 · 0 comments

Comments

@bpj
Copy link

bpj commented Nov 23, 2018

In the commandline app the line

print $bitly->shorten(URL => shift @ARGV), $/ while @ARGV;

should be changed into

print $bitly->shorten(URL => shift @ARGV)->{url}, $/ while @ARGV;

or even better

for ( @ARGV ) {
    my $url = $bitly->shorten( URL => $_ );
    $url = $url->{url} if 'HASH' eq ref $url;
    print $url, $/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant