#!/usr/bin/perl -w
###########################################
# typo - Get Yahoo! spelling corrections
# Mike Schilli, 2005 (m@perlmeister.com)
###########################################
use strict;

my $term = "@ARGV";

die "usage: $0 word/phrase ..." 
    unless length $term;

use Yahoo::Search AppId => "YOUR_APP_ID";

my($suggestion) = Yahoo::Search->Terms(
    Spell => $term);

if(defined $suggestion) {
    print "Corrected: $suggestion\n";
} else {
    print "No suggestions\n";
}
