Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

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/

Journal of Qiang (5577)

Wednesday February 21, 2007
03: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
01: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
05: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. :)

Friday January 20, 2006
04:16 PM

another reason why you should always use warnings

I was trying to figure out why this script not working..

#!/usr/bin/perl

while (<>){
  chomp;
  print;
  eval{
    local $SIG{ALARM} = sub{die "\n"};
    alarm 3;
    print " ",$1 if `bpcoverage -c $_`=~/(VERSION:.*)/;
    alarm 0;
  };
  alarm 0;
  next if $@;
}

after scratching my head for a while, I decided to add use warnings and strict then I got the complains that $SIG{ALARM} is unregistered signal. ARGH!! how stupid.. should have used $SIG{ALRM}

now I am going to start using strict and warnings no matter the lenght of the script!!

Monday December 26, 2005
02:30 AM

Perl 5 Internals book

i came cross this book while searching for hash bucket. http://www.faqs.org/docs/perl5int/ written by Simon Cozens on 2001.

seems to be a good book and It would be nice to be included in "online library" on Perl.org, either link or fullcopy.

licence looks okay too. /me emailing the webmaster[at]perl.org

This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).

Thursday December 22, 2005
11:32 AM

grow your beard and help Perl!

I came cross this blog entry talking about how beard fortell the destiny of a computer language. http://khason.biz/blog/2004/12/why-microsoft-can-blow-off-with-c.html

too bad the pics are all gone and i only found a translated chinese post with pics. http://xrl.us/ja67

not true but a funny read. now i am going to start growing my beard :-)

Friday December 09, 2005
12:58 AM

christmas perl monger social meeting

went to our local PM xmas social meeting. it is at a belgium restaurant called bire market. good beer and food. nice to see the members since i haven't been to the meeting since September.

do you have xmas social meeting in your local PM ?

12:51 AM

auto-build package , Perl in tru64

we run few OSes, irix, tru64, debian, solaris, AIX. once a while we have to build/rebuild certain package for each OS and it's such a pain in the neck. today i finally give up and decide to write a tools to semi-auto-build pkgs.

using OO perl, the first test on tru64 got me into bit trouble. you see, Perl 5.8.0 comes with OSF 5.1B2 base OS. the problem is that all the Perl build-in modules are not included with the base OS. modules are in OSFPERL. how on earth can they only include Perl in base OS but not the build-in modules!!??

Friday November 11, 2005
05:43 PM

useful links and meetups

two links pretty cool and useful.

the cpan search beta, faster and better result. http://search.cpan.org/search?mode=beta&q=cgi

then i found cpan suggest, works like google suggest. http://cpantools.com/ although i don't know how much usefull it is yet.

-------------

I found 2 chinese perl users in toronto through http://member.perlchina.org/ (developed in Catalyst). and plus two others (i have yet to meet) introduced by richard from our local pm.
we are going to have a social meetup tonight at a chinese hotpot restaurant. kinda make up the local pm meetings i missed since september due to time comflict.

------------ some random news about perlchina
note: the links are all in chinese.

the perlchina members in beijing are having a tech meetup on Nov 14 too. http://xrl.us/idwa

we have formed a catalyst study group in perlchina and keep a learning journal contributed by the group. link : http://www.livejournal.com/community/perlchina/

Thursday July 28, 2005
03:23 PM

quebec trip tips? and ruby hack

this long weekend, i am going to take parents to quebec (montreal,quebec city, charlevoix) and i worked up with a plan. you can see it here. http://xrl.us/gw4f

any suggestions?

UPDATE: 3 days trips is too stress for so many places. should have just visited montreal, quebec city. it was a good time nonetheless, parents took many pictures of the houses on the way :)

-------------------

also spend some time hacked the ruby wiki and add captcha token verification to stop robot spamming. damn spammers!
we are using instiki http://www.instiki.org/.

since this wiki using ruby on rail, i had to read up the newly published tutorials on onlamp. then I used a simple perl script to handle the captcha token part. I have to give Randal L. Schwartz credit as i stole most of the captch code from his article.

--------------------

i am attending our local perl monger meeting tonight. asterisk and perl. interesting... I think we are going to have the audio record as usual. keep an eye here http://hew.ca/talks_audio/