Need one more tweak...
Hi, I am almost done with my quest for a way to interact with a postgresql database with a Perl CGI. I am trying to find a way to interact with my database via my iPad and web access seems to be the key. I basically have a form with a text box, users can enter sql in the text box and hit the submit button and the Perl CGI will do its magic on all of the text in the box. Query results will appear as html tables. I would like one more enhancement... I would like to be able to 'select' some text in the text box and using possibly a different submit button have the CGI code only process the selected text. My gut feeling is that this might involve using javascript which is bad since it has been about Fifteen years since I have written any js code Can anyone offer any guidance? What I have now works well and looks good (to me) on the iPad but I think that being able to select text to 'execute' will improve the work flow. Thanks Jerry
Re: Need some help on installing modules...
On Jan 16, 2011, at 4:53 PM, John Delacour wrote: > At 11:13 -0500 16/01/2011, Levan, Jerry wrote: > >> I have an iPad and I have a Postgresql database on my home server. >> >> I have turned on the MacOS(client) VPN on the mac mini that I use >> as my home server and can access my home network in a secure fashion... >> >> It turns out that once upon a time I wrote a perl cgi that allowed >> me to access postgresql and display the results of selections in >> a html table. >> >> It appears that I need to install DBI and DBD for Postgresql. >> >> Unfortunately I have pretty much forgotten most of my Perl >> ( Sh*t happens when you get into your seventies...) >> >> Could some kind soul give me a quick guide on how to install >> the necessary modules to enable the cgi? > > Presuming you have the developer tools installed then use CPAN. I've > recently installed DBI and DBD::SQLite on my Mac Mini without any > complaints. I see that I am excluded from getting DBD:Pg because I > can't answer a simple question: > > Configuring DBD::Pg 2.17.2 > Path to pg_config? You tell me! > Use of uninitialized value $ENV{"POSTGRES_HOME"} ... > > But no doubt as a user of Pg and 4 years my senior you will be able > to answer it. > > > > 21:41:50 User:jd Cwd: /usr/lib > ➔ sudo cpan > Password: > Terminal does not support AddHistory. > > cpan shell -- CPAN exploration and modules installation (v1.9402) > Enter 'h' for help. > > cpan[1]> install DBI DBD::Pg > CPAN: Storable loaded ok (v2.18) > > > JD I compiled postgresql ( 8.4.4) myself and pg_config is living in /usr/local/bin but I have set /usr/local/bin as the target for all of the 'binarys' for the install. I am not sure how to use cpan properly ( espcially the install part ) I got a cpan shell by perl -MCPAN -e shell and did a 'install Bundle::DBD::Pg After much stuff flew by the install failed because I did not have root access... I did a sudo -s and restarted cpan. I did the install again and did not notice that DBD::Pg was installed ( DBI evidently was ok... I then did a 'install DBD:Pg' and it appeared that some errors were made and the install did not take place. I went ahead and did a force install and much to my surprise, my rempgsql.cgi worked! I have been able to connect to my db via http using the VPN and have done selects and inserts successfully. ( The auxiliary documentation is missing and the describe function does not work for schema qualified names). Safari forces all of the columns to fit on the screen which can make for very small entires ;( but I can zoom the window and read the table ok. The highest version of DBD::Pg I found was was 2.17.2 Is doing a: sudo perl -MCPAN -e shell The standard way of preparing to install modules? Seems like root might only be needed for actual installation... Thanks Jerry
Need some help on installing modules...
Hi, It has been about 12 years since I have had to think about Perl I have an iPad and I have a Postgresql database on my home server. I have turned on the MacOS(client) VPN on the mac mini that I use as my home server and can access my home network in a secure fashion... I would like to be able to easily access my database running on this server from my iPad. It turns out that once upon a time I wrote a perl cgi that allowed me to access postgresql and display the results of selections in a html table. It appears that I need to install DBI and DBD for Postgresql. Unfortunately I have pretty much forgotten most of my Perl ( Sh*t happens when you get into your seventies...) Could some kind soul give me a quick guide on how to install the necessary modules to enable the cgi? I have a fat libpq installed... The perl script rmtpgsql.cgi is located here: http://homepage.mac.com/levanj/Perl/ If you use Postqresql and have the dbd stuff installed and are bored you might give it a whirl and let me know if it still works. If I can get it working then I could use Safari on the iPad to provide easy viewing of my personal database. Thanks, Jerry
Linksys Perl Tools Location
Hello, I have "enhanced" my perlscripts that deal with the Linksys BEFSR router/firewall. It has been more than a couple of years since I have tried to build a web site, so forgive the clunkiness :) Site address: http://homepage.mac.com/levanj/LinkSys The main program is a script that I run at boot time that logs the incoming/outgoing tcp/udp connection attempts. Let me know if you find the stuff useful in any way. --Jerry
Re: Permanently add INC directory?
> Is there any way to globally add an INC directory to Perl after > compilation? > > I know about setenv PERLLIB5 and do that in my .cshrc. > > But it doesn't get set when I run Perl from within BBEdit or cron. > Is there any way to do this so it is truly global (it can just be > across me as the user or for all users, since I'm the only user > anyway, as long as that will work with things like BBEdit and cron). > > Thanks, > Peter. In a pinch you could do something like: push @INC , "Pathtofile" At the top of your program, you might have to use A Begin block to enclose the push for "use" access Rather than "require" access. --Jerry
Need a bit of advice on installing Perl
Greetings, I just "acquired" a shiny new 933MHZ G4 running MacOS X 10.1.3 and have installed the developer tools from Dec 2001. I compiled perl 5.6.1 tonight using a couple of hints posted on the macosx. com forums. When "make test" was executed I obtained 4 errors. 1) a failed test 303 ( just before lib/abbrev) 2) lib/db-tree failed at test 0 3) lib/db-recno failed at test 51 4) lib/posix failed at test 11 Are these "well know" failures that perhaps even the apple installed 5.6.0 will fail? If I pull the trigger on the "make install", what happens to: 1) the existing stuff in the /System/Library/Perl directory. ie is the directory deleted completely or do files not having the same name as installed files survive? 2) Will the install of 5.6.1 over 5.6.0 invalidate the Apache module stuff in the existing distribution? ( or any other dynamically loaded modules) If I do a "make install", should I do another h2ph run, if yes which include directories should be targeted? I want to ease my way into adding software so I am not terribly keen on having to potentially rebuild Apache and mod_perl... Darwin on HFS+ seems to have some gotchas. Thanks for any advice, Jerry