[Brisbane-pm] Help - I barely speak Camel.

Damian James djames at thehub.com.au
Sun Jul 30 17:55:26 PDT 2006


Hi Peter,

A couple more points that may be of use:

   - See the "perldsc" man page (type "perldoc perldsc" at a command 
prompt). If you need examples and ideas regarding complex data 
structures in perl, that's the very best place to start.
   - Investigate the Data::Dumper module, which you'll find invaluable 
while getting to know working with the more elaborate structures you 
end up making. This is the simplest way to check that the hash of 
arrays of hashes of lists is being populated the way you expected.
   - Playing with DBI may well be no effort compared to getting the DBI 
drivers for the databases you use installed on your platform! With that 
in mind, it's worth initially playing with DBI and DBD::CSV rather than 
Text::CSV so that moving on to a DBD driver that talks to real database 
servers is just a matter of changing modules.
   - "perl -MCPAN -e shell" is your friend. However, with many 
(especially binary and XS modules), the OS package tools may be the 
easier way to go, depending on the OS. This is where the linux and *bsd 
worlds have it to themselves. Under OSX you might set up darwinports or 
fink, but neither are quite as smooth as the real bsd ports, apt-get or 
yum (IME, at least). If you're on Windows, you'll want to use the 
package tool that came with your perl (ppm for ActiveState, dunno what 
people using IndigoPerl do).
   - Use CGI.pm. Set yourself exercises writing little state-keeping 
scripts that generate multiple pages. Read the pages about it on 
Lincoln Stein's own website, which have more detail than the man page.

More aptly I guess, you should have a go and feel free to ask any 
questions that come up here on the list. Getting your issues down to 
specifics is really up to you, but many people here will be happy to 
answer specific technical questions as they arise.

Cheers,
Damian

On 28/07/2006, at 4:53 PM, Sarah Smith wrote:

> Peter Machell wrote:
>> Hi list. Jacinta Richardson suggested I join. I'm a fairly junior
>> sysadmin, by no means a programmer. I have hacked bits and pieces in
>> Perl over the years and find it very good for glue, but do this so
>> infrequently that I need to relearn even the basics each time.
>>
>> I need to develop a simple application and would like to do so in
>> Perl. Is this list an appropriate place to ask questions about this
>> with a view to better understanding and refining my code?
>>
>> Assuming that it is, can I start with the workflow and see if it
>> makes sense?
>>
>> I need to interface with a number of different databases to pull out
>> some demographic information, feed this into an array, regex it to
>> get the formatting right, then send it, and a message containing
>> variables from this info, to an API for which I have a Perl example.
>> Returning from that API will be some debug, which I'd like to combine
>> with the information and print out to a HTML file for reporting.
>>
>
> Perls CGI module will do what you need and has a great man page.  Try
> "man CGI" on your Apple OSX machine.
>
>> As I'm dealing with a number of different database engines, I figure
>> I'll do the initial data mining using those engine's tools, and start
>> the Perl code with pulling data from a CSV file. This seems easier to
>> me than trying to get a DBI going for each engine and using Perl to
>> do the queries.
>>
> Sure.  For one off reports that's probably fine.
>> I'm sure there are many on this list that could knock this up in a
>> few minutes, but I'd really like to do it myself so that I can
>> completely understand the process, and continue to develop and
>> support it.
>>
> I think if you're treating this partly as a learning experience then
> doing the DBI code would probably be a good thing.
>
> Also if you have to run the script more than once its going to be more 
> a
> complete solution if it can be run directly from the databases without
> having to go thru some intermediate manual steps first.
>
> When doing DBI coding I usually use the console based tools for the
> database to make sure my SQL is working and then code it up in Perl.  
> So
> you'll need to go thru that step first anyway.
>
> Also you talk about feeding the data into an array - you might find 
> that
> methods like fetchrow_hashref will do a lot of the work you're thinking
> of doing for you.
>> Please let me know if this is an appropriate forum for this sort of
>> thing, and if not, where I may find one.
>>
> I'm sure folks on this list will help where time permits.
>
>
>> Thanks in advance,
>>
>> Peter.
>> _______________________________________________
>> Brisbane-pm mailing list
>> Brisbane-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/brisbane-pm
>>
>>
>
> _______________________________________________
> Brisbane-pm mailing list
> Brisbane-pm at pm.org
> http://mail.pm.org/mailman/listinfo/brisbane-pm
>



More information about the Brisbane-pm mailing list