For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > July 2007 > Writing a Program









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Writing a Program
Cj

2007-07-18, 3:59 am

To all you who know:

I'm trying to write a program, granted it's going to be a large one,
that will keep track of people's computers when they're in my shop
being repaired. I want to assign a number to each computer system,
and that number will stay with that machine throughout the program. I
want to be able to see when the computer is taken in, where it is at
the time, etc...

My question is this:

How would I go about writing this program in perl, and is perl the
language to write it in? I'll use MySQL to store the data. The
reason I chose perl is because I like linux, and perl runs excellently
in linux, and I'd like to do my developing on a linux box.

Yitzle

2007-07-18, 3:59 am

I'm not the most qualified to answer this question, but if all you
want is a simple menu driven interface for a MySQL DB, Perl should be
an easy way to accomplish it.
Using a graphical module you should also be able to make a nice GUI.

If you are going to go ahead, you want to first learn the basics of
Perl. You can get started at http://www.perl.org/
Once you are familiar with the language, take a look at
http://search.cpan.org/~capttofu/DB...ib/DBD/mysql.pm
I think that's the commonly used library for MySQL.

HTH
Daniel Kasak

2007-07-18, 3:59 am

On Wed, 2007-07-18 at 03:56 +0000, CJ wrote:

> To all you who know:
>
> I'm trying to write a program, granted it's going to be a large one,
> that will keep track of people's computers when they're in my shop
> being repaired. I want to assign a number to each computer system,
> and that number will stay with that machine throughout the program. I
> want to be able to see when the computer is taken in, where it is at
> the time, etc...
>
> My question is this:
>
> How would I go about writing this program in perl, and is perl the
> language to write it in? I'll use MySQL to store the data. The
> reason I chose perl is because I like linux, and perl runs excellently
> in linux, and I'd like to do my developing on a linux box.


You've made all the right decisions already :)

This sounds like an excellent use for my 'Axis' project:
http://entropy.homelinux.org/axis

You'll have to design your tables in MySQL. Then design your GUI with
Glade ( which designs Gtk2 interfaces ... Gtk2 is the widget toolkit
that gnome uses ). Then create some Gtk2::Ex::DBI and
Gtk2::Ex::Datasheet::DBI objects to connect your tables to your forms.
It's remarkably easy, requires *very* little code, and I'll help you out
if you get stuck.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@nusconsulting.com.au
website: http://www.nusconsulting.com.au

Zentara

2007-07-18, 6:59 pm

On Wed, 18 Jul 2007 03:56:10 -0000, cjburchfield@gmail.com (CJ) wrote:

>To all you who know:
>
>I'm trying to write a program, granted it's going to be a large one,
>that will keep track of people's computers when they're in my shop
>being repaired. I want to assign a number to each computer system,
>and that number will stay with that machine throughout the program. I
>want to be able to see when the computer is taken in, where it is at
>the time, etc...
>
>My question is this:
>
>How would I go about writing this program in perl, and is perl the
>language to write it in? I'll use MySQL to store the data. The
>reason I chose perl is because I like linux, and perl runs excellently
>in linux, and I'd like to do my developing on a linux box.


I wrote something like that using Tk. It can use SQLlite, Postgres, or
Mysql. It is sort of a general database for anything; with a sidebar
with a photo, and a Notebook(multipage for each entry). It has
auto-text-save when you enter something in a notebook page, then
switch to another page.

There is a conf file so you can change the Notebook page titles,etc.
to customize it to your shop.

Download the full demo from
http://perlmonks.org?node_id=338291

When you first run the program, it will build a bunch of thumbnails
from the photos you have in pics. Then it will open only showing the
administrator entry.
Click "SQL Queries" from the Top Button Bar,
and Hit enter on Select * from info.
That will pull out all entries, and you can play with them.
Adding entries should be self-explanatory.
Searching should be self-explanatory.

It's actually a very simple program, but I spent a bit of time
condensing the code, so it may seem hard to follow at first.
It all in hashes, though.

zentara



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Jefferson Kirkland

2007-07-20, 7:02 pm

On 7/17/07, CJ <cjburchfield@gmail.com> wrote:
>
> To all you who know:
>
> I'm trying to write a program, granted it's going to be a large one,
> that will keep track of people's computers when they're in my shop
> being repaired. I want to assign a number to each computer system,
> and that number will stay with that machine throughout the program. I
> want to be able to see when the computer is taken in, where it is at
> the time, etc...
>
> My question is this:
>
> How would I go about writing this program in perl, and is perl the
> language to write it in? I'll use MySQL to store the data. The
> reason I chose perl is because I like linux, and perl runs excellently
> in linux, and I'd like to do my developing on a linux box.
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>


And for your reading pleasure and enjoyment, this should help as well:
http://www.perl.org/books/beginning-perl/

Regards,

Jeff

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com