Page Index Toggle Pages: 1 ReplyAdd Poll Send Topic
Normal Topic Why Perl Mongers don't play with mySQL (Read 6558 times)
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Why Perl Mongers don't play with mySQL
Aug 14th, 2015 at 2:05pm
Mark & QuoteQuote  
  • Old habits of creating flat files are hard to break and Perl's functional limit on the size stored things is based on memory and server capacity, not a 64 KB text field content max.
  • Flat files are extremely portable.
  • The documentation on the Perl side is abysmal.
    • Most Perl programming books appear to either ignore using databases or have a tiny section that says 'Oh, yeah, you can these Perl modules to access database systems'
    • The last book (that I can find) dedicated to using mySQL and Perl (not PHP) was published in 2001 and assumes you can't build a form without using CGI.pm. There's a new book out in December that looks promising - but it won't be available until December. Angry
    • MySQL books (without PHP) are a little better - they might have a whole section on getting Perl to talk to a database. :Smiley
  • Did I mention: The documentation on the Perl side is abysmal?!!


AACK! Smiley

(This rant brought to you courtesy of a client who hired a graphics/CMS designer and a new CMS system that can't handle data stored in the cgi-bin.)
« Last Edit: Aug 8th, 2016 at 4:18pm by Dandello »  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box pyragony54
Language
***
Offline


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: Why Perl Mongers don't play with mySQL
Reply #1 - Aug 24th, 2015 at 1:35pm
Mark & QuoteQuote  
Maybe I understand now what's wrong. Maybe help you finished modules.

http://search.cpan.org/search?query=SQL&mode=all
  

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: Why Perl Mongers don't play with mySQL
Reply #2 - Aug 24th, 2015 at 2:07pm
Mark & QuoteQuote  
The DBI module actually works fine for Perl (I just converted one of my clients to storing almost all their membership and searchable data in mySQL - the actual conversion was a pain and a half but now that it's done the data can be accessed via Perl and PHP.)

The problem - as I see it - is that mySQL has been 'married' to PHP for so long that in order to find the instructions for how to do anything you have to wade through 'how to make a form in PHP'. And that's pretty off-putting for Perl mongers who are trying to figure out how to update an entry in an SQL table (without opening phpMyAdmin) when they can write the equivalent for a flat-file in their sleep.  :Smiley

There are a few places on the 'net with Perl/SQL tutorials that are pretty good.

  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box pyragony54
Language
***
Offline


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: Why Perl Mongers don't play with mySQL
Reply #3 - Aug 24th, 2015 at 3:31pm
Mark & QuoteQuote  
I once wanted a little. Unfortunately, there is virtually no Forum Software in PERL. One thing I have found, however, and once downloaded. According to the description, it is to have a database. Look easy at times. Maybe that helps further.

http://netbula.com/anyboard/
  

anyboard_free.zip ( 738 KB | 276 Downloads )

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box pyragony54
Language
***
Offline


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: Why Perl Mongers don't play with mySQL
Reply #4 - Aug 24th, 2015 at 3:42pm
Mark & QuoteQuote  
Here are a.
Looks pretty good.


Code (Perl)
Select All
use DBI;
 # connect to database

 $db = DBI->connect("DBI:mysql:mysql");

 exit;
 sub get_boards{
 $query = dbquery("SELECT * FROM boards");
 }

 # preps and execs mysql queries..
 sub dbquery {
   $dbqueries++;
   my $q;
   $q = $db->prepare(shift);
   $q->execute();
   return $q;
 }

 sub package_boards{
 while (my $row = $query->fetchrow_hashref) {
   my %boarddata;
   for my $key (keys %$row) {
     $boarddata{$key} = $row->{$key};
   }
   @boards[$boarddata{board_id}] = \%boarddata;
 }
 }
 sub get_cats{
 $query = dbquery("SELECT * FROM categories ORDER BY priority DESC");
 }
 sub pack_n_print_cats{
 my %outboards;
 while (my $catdata = $query->fetchrow_hashref) {

   undef %outboards;
   # category header
   $template->setvar('cat_id', $catdata->{category_id});
   $template->setvar('cat_name', $catdata->{name});
   $template->pparse('boardindex/category_top.html');

   # figure out what boards in current category...

   foreach my $board (@boards) {
     if ($board->{category_id} == $catdata->{category_id}) {
       $outboards{$board->{priority}} = $board->{board_id};

     }

   }
   foreach my $key (reverse sort keys %outboards) {
     my $board = @boards[$outboards{$key}];         #you has it as @boards[$out....i dunno?
     $template->setvar('board_id', $board->{board_id});
     $template->setvar('board_name', $board->{name});
     $template->setvar('board_desc', $board->{description});
     $template->setvar('board_topics', $board->{topics});
     $template->setvar('board_replies', $board->{replies});
     $template->setvar('board_lastpost_id', $board->{lastpost_id});
     $template->setvar('board_lastpost_author', $board->{lastpost_author});
     $template->setvar('board_lastpost_title', $board->{lastpost_title});
     $template->setvar('board_lastpost_time', $board->{lastpost_time});
     $template->pparse('boardindex/board.html');
   }
   # category footer
   $template->pparse('boardindex/category_bottom.html');
 }
 }
 1;
  

  

Build190.zip ( 2665 KB | 275 Downloads )

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: Why Perl Mongers don't play with mySQL
Reply #5 - Aug 24th, 2015 at 4:40pm
Mark & QuoteQuote  
Since I'm playing with converting a lot of my personal stuff to Perl/mySQL I'm taking mental notes on how to start configuring YaBB databases.

That's probably going to be the hardest part - getting the current data configured to take advantage of SQL strengths - picking out only what you need for a specific screen or action. Like for the message display - instead of loading the entire user file into a hash, just load what the page actually needs.

So I figure we'll be looking at how PHP forums configure their data and pick out what makes sense for YaBB's data
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Anon
Guest


Re: Why Perl Mongers don't play with mySQL
Reply #6 - Sep 13th, 2015 at 11:17pm
Mark & QuoteQuote  
Guest test
  
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
Junior Member
**
Offline



Posts: 62
Location: Miami, FL. USA
Joined: Oct 4th, 2014
Gender: Male
Zodiac sign: Aries
Re: Why Perl Mongers don't play with mySQL
Reply #7 - Sep 15th, 2015 at 3:25am
Mark & QuoteQuote  
Playing with the Anon posting huh?   Smiley
  

Florida Classics and Muscle Car Automotive Forum Administrator
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: Why Perl Mongers don't play with mySQL
Reply #8 - Sep 15th, 2015 at 2:22pm
Mark & QuoteQuote  
Yup. But on the SQL side - After I have my other major 'fed by flatfile' site updated and converted to SQL (but not PHP), I'll start working on converting YaBB to DB with well optimized queries. (But it won't be this month or possibly next - the site I'm working on is HUGE and I'm learning how to optimize the queries and processes as I go.)

Note to everybody: We've already determined that we will not repeat the mistakes of 3.0. Once a YaBB install is converted to DB, it won't be backwards convertable from within YaBB. BUT, once it's done, we should be able to create converters to import data from other forum programs.

Now if somebody has time and the inclination, we still don't have a Mobile template.  Undecided
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: Why Perl Mongers don't play with mySQL
Reply #9 - Jan 10th, 2021 at 12:41pm
 
Off-Topic replies have been moved to this Topic.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
Why Perl Mongers don't play with mySQL

Please type the characters exactly as they appear in the image,
without the first 2 and last 2 characters.
The characters must be typed in the same order,
and they are case-sensitive.
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Off Topic Comment Insert Spoiler
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Change Text Color
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: %
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry