Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Qiang (5577)

Qiang
  (email not shown publicly)
http://www.goodspot.ca/

on the jurney of bringing more Perl development into work!

York University, Toronto, Canada

Journal of Qiang (5577)

Friday March 28, 2008
02:08 PM

off to china

I finally decided to take some time off from work and visit my parent in china. It has been 5 years since my last visit -- 2003 during the SARS breakout.

one of the main reasons is to try to help out the family business(printing). the business has been growing steadily and expanded to other cities. as the only son in the family, my choice is to at least try it out before giving it up. so I am going to be in beijing and possibly shanghai for a while.

if i get the time, I may have chances to try out some ideas:
        * write and host applications like the 37signals guys
        * resume a webapp ( a rewrite based on my goodspot.ca but more features )

also meet up with the people from perlchina.

it will be interesting!
Monday February 25, 2008
01:57 PM

spammer on use.perl ?

does smriti look like a spammer to you? his journal http://use.perl.org/~smriti/journal/

Thursday October 25, 2007
03:17 PM

stuck with 5.8.4

a quick rant...

Our sysadmin mentioned that we can't install second Perl into solaris local zone because that may mess up with the Perl(5.8.4) that is part of core solaris master zone(the guy mentioned something about share library linking issue). but 5.8.7 is our standard and the unix support team also supplies us mod_perl, Template-Toolkit, DBI and Oracle-DBD solaris packages.

not that i think 5.8.4 would be much of a problem considering most of our apps are not that complicated and run in plain CGI mode. but a downgrade to 5.8.4 has too much uncertainty that makes me uncomfortable.

i think the unix team hasn't realized how much work they have created for them (when they say they don't have time to solve this problem and get 5.8.7 installed in local zone) and they probably will have to recreate the solaris packages and god knows how they going to install mod_perl to the master zone for perl 5.8.4.

i felt the urge to install my own Perl...
Thursday July 19, 2007
12:08 AM

I am a big foodie

well, I love to try out different kind of food. I even build a restaurant review website ( http://www.goodspot.ca/ ) that is dedicated to the local restaurants so that i can find the best one right from my fingertips. :)

the site was built using CGI::Application, Template-Toolkit as an excuse to learn more about writing perl webapp.

it has been 6 months since i last touched the codebase. now i finally got some time and urge to make it work better (at least for me :)

the first thing i want to do is to refactor the code to make it easy to extend. currently it is one big module (Main.pm) that uses other module and handle all front-end requests. it is hard to maintain and i can't put the whole thing into my head.

the next thing would be to improve the current functionalities and adding more features. I have been thinking of it and i find it to be harder than the coding :D

on a whim, how many of you run a site like this? would be interested to know your experience. I know Dave Rolsky runs the http://www.vegguide.org/
Thursday May 17, 2007
10:33 AM

database layer separation

we are not writing big Perl software yet. most of them are small and few medium. We started with plain DBI and i am getting tired of writing prepare, execute, selectall_arrayref($sql,{Slice=>{}},@bind) quickly now.

I don't want to introduce ORM just yet as it is a pretty big change and i got lots other things to push to our Perl development. but I definitely see it as the way to go in the long run if our Perl development get bigger.

after some searching, I have found DBIx::Simple - a thin layer to DBI. I like the syntax and it is simple enough. tried asked other monks opinion on perlmonks and no answer so far.

I will spend more time to try it out. if it all goes well, DBIx::Simple will become one of our standard modules among TT and CGI::Application.
Monday April 02, 2007
12:39 PM

module install

applications we wrote run on Solaris exclusively. all the modules and plugins are installed out of solaris packages. i.e we have to wait for the unix team build and install it for us first. aparently they are busy as hell and the difficulities of installing Perl modules usually make things worst. thus a request may take weeks to finish.

for the pure Perl module, this is not much issue. we just drop it to our common lib directory.

today i need Text::CSV_XS to parse lots of CSV files. but alas.. it is XS.

i am glad that Perl usage at my workplace is going up. but this just slows thing down. another example, the mod_perl request's been in the queue for two weeks .. :-(
Tuesday February 27, 2007
05:16 PM

WebSites running on Perl

my manager's boss is asking this question. I guess he wants the BIG ( popular, mission-critical, e-commerce) websites mostly built on Perl.

i compiled a short list. btw, why aren't there anything on perl.org?

  1. amazon.com
  2. Bank of Canada
  3. BBC
  4. ticketmaster
  5. PBS
  6. University of Buffalo
  7. Wired magazine
  8. del.icio.us
  9. livejournal
  10. vox
  11. ncaasports.com
University of Buffalo is here because we are a University too.

livejournal and del.icio.us are probably less known to the manager. OTOH, myspace or youtube will be difference case.

any other convincing sites?
Wednesday February 21, 2007
04:28 PM

install Scalar::Util XS version.

Weak references are not implemented in the version of perl that is the error i got when installing Task::Weaken (part of Perl::Critic prereq) which test if Scalar::Util has the XS weaken function. S::U on this system is pure-perl version. therefore the error msg.

the solution is to recompile Scalar::Util with XS support.

here is what i did to install Scalar::Util 's XS version to my HOME dir. soaris 8.

Scalar::Util uses Module::Install which uses $Config::Config{cc} which points to a non-existen location. %Config is read-only. ExtUtils::FakeConfig comes to rescue.

#pwd
/home/qiang/.cpan/build/Scalar-List-Utils-1.19

#cat my_Config.pm

package my_Config;

use ExtUtils::FakeConfig cc => 'gcc';

1;

#perl -Mmy_Config Makefile.PL PREFIX=/home/qiang/perl/ INSTALLDIRS=site
#make LD=gcc
#make test
#make install

lesson learned: i was trying to test the 'weak' function in Scalar-List-Utils-1.19 built directory after make by running perl -e 'use Scalar::Util qw(weaken)' which always give me error saying 'weaken function is not implemented in this version of perl'.

after a few failed tries, i did

% perldoc -l Scalar::Util
lib/Scalar/Util.pm

hmm. there is another copy of it under blib/.

% perl -e 'BEGIN{unshift @INC,"/home/qiangl/.cpan/build/Scalar-List-Utils-1.19/blib/lib"};use Scalar::Util qw(weaken)'

that worked. here I come, Perl::Critic

Wednesday February 14, 2007
02:06 PM

introduce coding standard and best practices

lately, i have been thinking about how to introduce coding standard, best practices to our team. Perl is still a relative new language we use to write webapp. so the level of Perl knowledge people have here is not high. however, everyone seems busy working on something and it is hard to find a way to get everyone involved (even though we have copies of PBP).

then i listened the new perlcast audio on Perl::Critic. funny that my concern is exactly why the Perl::Critic author created the module.

I can even try check codes on perlcritic.com. the result i am getting is pretty good. high-lighting, different severity settings and detail explanations. fast and simple.

the next step is to get people run the code through Perl::Critic and get advice from there. :)

great module. thanks!
Monday November 27, 2006
06:52 PM

Start Testing

I have been in a new role at work (different team but same org) for two months. i was supposed to be doing mostly sysadmin work which is what i was doing before, plus sofeware deployment and some of Perl webapp development ( both i had never done professionally ).

but i started to write Perl app from the day one which i am quite happy. now i just finished the second app. however, it occurred to me that no one here writes much test for their programs( either WebObjects or Perl ). Including me :~.

so my current goal is to learn testing. i have went through few articles from Perl.com and Test::Tutorial. the ones i found useful are

  • Building Testing Libraries
  • An introduction to Quality Assurance
also found a pdf version of Test::Tutorial (2004 version) which seems to be more content than the CPAN version.

There are lots Test::* modules out there and i am not sure which one is suitable for the usual Database, Form testing. the one s i found may useful are

  • Test::Simple
  • Test::More
  • Devel::Cover
  • Test::Deep
  • Test::WWW::Mechanize
there are bunch of DBD:: mock modules seem good for DB testing.

arr.. i wish i went to the Toronto YAPC testing talks. :)