Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use WWW::Google::Calculator;
- use Data::Dumper;
- &calculate('100 cm in inches');
- sub calculate {
- my $what = $_;
- my $calc = WWW::Google::Calculator->new;
- my $result = $calc->calc($what);
- print Dumper($result);
- if(!$result) {
- print "No result\n";
- } else {
- print "Result\n";
- }
- }
- # Produces
- # $VAR1 = undef;
- # No result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement