![]() Preserved Topic: Learning to program (Page 1 of 1) |
|
|---|---|
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-10-2001 22:47
I really would like to learn how to program in Perl but I have no idea where to start. All the books I've bought on it assume you already know how to program in some other language. Do I need to learn another language before I try to learn Perl? Has anyone here learned Perl as their first programming language and if so how did you learn it? |
|
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 04-10-2001 23:36
When you try to read these books what do you get hung up on? I have never done a lot of programming, but then, I learned little bits from the age of 14 on up, so it all seems fairly straightforward to me. If you are totally lost, just search the net for a primer of some sort, I don't imagine it would take that much to get into an average Perl book. If you are just having trouble with some specific concept, post here! I'd love to be able to answer a question instead of just asking all the time |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-10-2001 23:42
I've learned what certain things do in Perl but I have no understanding of how I could put these things together to make something functional. Like for instance I would like to be able to write to a text file from a web page submission and be able to query the text file. I have no idea where to start on something like that. |
|
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 04-10-2001 23:59
Unfortunately I have no experience writing perl code, I've done some installations of scripts and edited it a bit. The first thing is to have a place to test out your stuff. I'm assuming you have some sort of shell account with cgi access. Your script needs to go in the cgi-bin directory and have the file permissions set appropriately , where it can then be accessed via a web browser by |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 00:03
I think I might be as far along as you.... |
|
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 04-11-2001 00:11
What about gutting an existing perl script and filling in your own commands? |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 00:13
yeah I don't understand a lot of the syntax....like when to use this versus that etc... |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 00:16
one thing in particular that I would love to create right now is a database based on a web page I run at work that lists the DVD movies owned by about a dozen people. |
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 04-11-2001 03:48
Boudga: First: What platform are you running on? Second: What database are you using? Third: What version of Perl are you using? |
|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 04-11-2001 06:20
Perl was my first language and regretably I have cease using it. But it does serve a great purpose. I learned of off a website, that was back in the days where I had no money, my parents didn't know what programming was, and I thought I could learn anything off of the web, I learned HTML didn't I... God, have to laugh at yourself for the being so naive, thinking HTML was a programming language. |
|
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 04-11-2001 08:17
Boudga, since you're using ActivePerl, you can use PPM to install necessary perl modules for connecting to MySQL db server. Just open up command prompt and type "C:>ppm" [enter]. Now, type "PPM>install DBI" [enter] and "PPM>install DBD-Mysql" (you must be online when doing this). If everything went well (you can check this by typing "PPM>query" [enter], and you should see "DBI" and "DBD-Mysql" on the list). Now you have everything that is needed for connecting to MySQL db server. A small intro how to use this can be found here: http://www.ozoneasylum.com/Forum12/HTML/000091.html |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 15:20
hyperbole: Windows NT 4.0, no DB created yet, Active State Perl 522 |
|
Paranoid (IV) Inmate From: other places |
posted 04-11-2001 16:33
I recommend the O'Reilly books: _Learning Perl_, called the llama book, and _Programming Perl_, called the camel book. When you think you're comfortable with those, _Effective Perl Programming_ (Addison-Wesley) is a must. If "see one do one" is more your learning style, the _Perl Cookbook_ is a winner. Chapter 14 of the cookbook is all about database access. |
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 04-11-2001 17:24
Boudga: There are two modules that may be of use to you: DBD-ODBC and DBI. |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 17:34
I knew about how to create a comma delimited file... |
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 04-11-2001 20:41
Either way would be appropriate. It depends on which is easier for you to create and to a lesser extend how you will use the data once you get it into the program. code: open(INPUT_FILE, "< filename");
code: foreach $line (@list)
code: foreach $name (sort keys %DVDs)
|
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 20:45
whoa, right over my head...I think I might have understood 25% of that post Hyperbole |
|
Paranoid (IV) Inmate From: other places |
posted 04-11-2001 20:47
hyperbole >>One of the most confusing things about Perl is that a variable changes its prefix depending on how you are accessing the data it contains. |
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 04-11-2001 20:56
I agree liner. |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 21:23
on the print part of your directions...do you mean print to the DB or print out the results of a query? |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 21:24
I'm going to attempt to put this into action...bare with me on this ok? |
|
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 04-11-2001 21:26
hyperbole...what's your ICQ uin? I'd like to talk to you privately about something that is OT.. |
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 04-11-2001 21:29
ICQ #95202104 |
|
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 04-11-2001 21:50
The unadorned printf in the third code segment will print to the screen (standard out). code: open(OUTPUT, "> filename")
|