Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: A Service to shorten URLs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: A Service to shorten URLs
Authored by: S Barman on Aug 26, '10 09:34:37PM
Just to be UNIX correct and to shorten the script:
#!/usr/bin/perl
use LWP::Simple;

my $url = shift || die "usage: $0 url_to_shorten\n";

getprint("http://qgf.in/api.php?url=$url");
print "\n";
In this case, using the die function prints the message to STDERR and does end with a non-zero return code, both being more UNIX friendly.

Scott

[ Reply to This | # ]