Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Dictionary.com (PLEASE critisise...)

by Mission (Hermit)
on Jun 22, 2001 at 00:47 UTC ( [id://90529]=note: print w/replies, xml ) Need Help??


in reply to Dictionary.com (PLEASE critisise...)

Draxil, I tried to run your code, but it appears (after searching CPAN) that Gtk.pm is only availble for Unix (I'm on Win) so I couldn't test your code. I'll leave it up to you to determine if it works correctly. So I'll list some suggestions instead just from browsing through your code.
  • You should use #!/usr/bin/perl -w to turn on warnings. This is a comment that many monks suggest. It helps in debugging, so it's always a first step.
  • You should use strict; which will make sure that you are using 'clean' Perl code. (Again, this is something that almost every monk will tell you is necessary/manditory.) You will probably have to add a lot of 'my' declarations to your variables (ie: my $http= new HTTP::Lite;) to elminate some errors.
  • I'm not so sure about this point, but I know that I personally wouldn't use the variable $pack since pack is a function of Perl and described in Perlfunc. I guess I'd be leary of using such a variable... again this is a personal choice.
  • When you use your or die statement, make sure you include in your error message $! to include the system error messages, in addition to your message (ie: or die "Couldn't retrieve the Word Of The Day.$!";.)
  • I like the fact that you commented your code. It's easy to follow and the logic makes sense. I think the code is really good for being 'half asleep.'
Please keep posting code and participating at Perl Monks. I learned a thing or two from your code just by doing a read through. If you have questions, post them, and if you have some help for someone, feel free to participate Draxil. Welcome to Perl Monks.

- Mission
"Heck I don't know how to do it either, but do you think that's going to stop me?!!"
  • Comment on Re: Dictionary.com (PLEASE critisise...)

Replies are listed 'Best First'.
GTK.....
by PsionicMan (Beadle) on Jun 24, 2001 at 06:14 UTC
    Gtk.pm is only available for *nix because Gtk.pm is a perl interface to GTK+'s (The Gimp Toolkit) widget set. It is the underlying power of the Gnome desktop environment. There is a native win32 port of Gimp/GTK+ available here. I don't know how successful you'd be if you tried to rig it up so that it would work with Gtk.pm, though.

    --Psi
    print(pack("h*","e4f64702566756e60236c6f637560247f602265696e676021602075627c602861636b65627e2")."\n");

Re: Re: Dictionary.com (PLEASE critisise...)
by Draxil (Novice) on Jun 26, 2001 at 17:28 UTC
    Hey thanks!

    I have taken a while to write this reply because I have been trying out your advise on some more perl scripts ;) .

    It's a shame no-one has done bindings for Gtk for windows yet.. I might just use Tk for GUI stuff from now on so I can pass it on to Windows users. Soon I will build up confidence to post some non half asleep code.. All with use strict and warnings enabled :P


    DrAxIl

    "blue berry muffins are not just a snack.... ..they are a way of life"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://90529]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-20 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found