getter setter and database

2006-05-16 Thread Ken Perl
suppose I have a table person with following columns, name, age, salary. If use OOP to write a class like this, package Person; sub new{ $class=shift; my $self = {}; $self->{_name} = undef; $self->{_age} = undef; $self->{_salary}= undef; bless ($self,$class); return $self; }

Re: getter setter and database

2006-05-17 Thread Ken Perl
tt <[EMAIL PROTECTED]> wrote: On Wed, 17 May 2006 08:23:11 +0800, Ken Perl wrote: > suppose I have a table person with following columns, name, age, > salary. If use OOP [snip] > My question is, should I query/update the table at the same time in > above accessor method? Some

hashref and hash

2006-05-18 Thread Ken Perl
I am writing the new method for class Empolyee which inherited from the base Person, the Person's new emthod expects a hash as its parameters, because it is a class using Class::DBI. The Employee's new method use hashref as its parameters, so how should I write the new method for class Employee? i

rebless another object

2006-05-18 Thread Ken Perl
hi, how to rebless another object in current package's constructor? could somebody give me an example? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

Re: rebless another object

2006-05-18 Thread Ken Perl
yes, this is helpful, so I won't re-bless any object now. On 5/18/06, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 5/18/06, Ken Perl <[EMAIL PROTECTED]> wrote: > how to rebless another object in current package's constructor? could > somebody give me an example?

print Greek small letter alpha in html

2006-06-14 Thread Ken Perl
hi, To print Greek small letter alpha in a html page, I tried to print this in perl but not work, B1; could someone give me some clue how to make this work? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

Re: print Greek small letter alpha in html

2006-06-14 Thread Ken Perl
thanks, it works. On 6/15/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: On Thu, 2006-15-06 at 10:04 +0800, Ken Perl wrote: > hi, > To print Greek small letter alpha in a html page, I tried to print > this in perl but not work, > B1; > > could someone give me some cl

web 2.0 module

2006-06-23 Thread Ken Perl
hi, does anybody know any mature web2.0 modules on CPAN? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

modules maillist

2006-07-03 Thread Ken Perl
hi, Is there a maillist talking about or seeking a module to a specific requirement? For example, I want to write a module or application to store all the glossary in my head, first, I search it on cpan.org but and don't find any userful module, but I still want to confirm that no one hasn't done

non fixed number of properties in constructor

2006-07-19 Thread Ken Perl
hi there, I find a difficulty when writing the constructor which may has dynamic and non fixed number of properties, say we want to construct a new class Account, package Account; sub new { my $class = shift; my $self = { currency_us=>undef, currency_fr =>undef, }; bless

Re: non fixed number of properties in constructor

2006-07-19 Thread Ken Perl
; If I want to support this method, I have to modify the constructor again to add the new country, but what I am looking for is the solution that doesn't need to modify the constructor again. On 7/19/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Ken Perl wrote: > > I find a difficul

Re: non fixed number of properties in constructor

2006-07-20 Thread Ken Perl
I almost got the ideas with all your replies, thanks. On 7/20/06, D. Bolliger <[EMAIL PROTECTED]> wrote: Hi Ken Ken Perl am Mittwoch, 19. Juli 2006 12:04: > ok, let me explain what I mean. Better done by inline/bottom posting, if you already got a bottom answer :-) > $account =

xml::simple declartion missed

2006-07-20 Thread Ken Perl
hi, The code's output doesn't include the xml declaration , how to fix the issue in the program? use XML::Simple; my $cust_xml = XMLin('./customers.xml', forcearray=>1,KeepRoot=>1); for my $customer (@{$cust_xml->{customer}}) { # Capitalize the contents of the 'first-name' and 'surname' elemen

extracting NAME and DESCRIPTION sections from pod text file

2006-08-13 Thread Ken Perl
what's correct regular expression on extracting only NAME and DESCRIPTION section from pod text file? I have tried this, but failed! perl -e '$c=`pod2text /data/WebGUI/lib/WebGUI/User.pm`;$c =~ s/(NAME.*)SYNOPSIS/$1/;print $c' -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

write smiley to file

2007-11-23 Thread Ken Perl
I use following piece of code to write smiley Unicode string into a file, use Encode; my $smiley = "\x{263a}"; open my $out, ">:utf8", "file" or die "$!"; print $out $smiley; however, if we dump the output file in binary mode, the hex looks wrong, it isn't 263a, any idea what's wrong with the co

nmake error

2005-08-11 Thread Ken Perl
Anybody knows what the nmake error means? Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\activePerl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness( 0, 'inc', 'blib\lib', 'blib\arch')" t\0-signature.t t\1-b

copy and run a program on remote windows

2005-08-18 Thread Ken Perl
I want to implement a module in perl to do the same thing as the tool PsExec (http://www.sysinternals.com/Utilities/PsExec.html) does, which is used to copy and run a program on remote windows, a very cool tool! So, I want to know if anyone has done this before. and If I do the implement from scr

Re: Perl Interview Questions

2005-08-24 Thread Ken Perl
What the name of the big company? On 8/25/05, Chris Devers <[EMAIL PROTECTED]> wrote: > On Thu, 25 Aug 2005, praba har wrote: > > > I am working as perl-cgi programmer in a small company. I got a > > call from the big company for Perl developer post. So I need perl > > related interview p

encrypt the password stored in a file

2005-08-28 Thread Ken Perl
The password used to access a ftp server is stored in a text file, the perl program gets the password from the file, the pass it to the ftp server for logon, this is the background. The requirement is encrypt the password store in a more secure way, and the perl program could still use the encrypte

Re: encrypt the password stored in a file

2005-08-30 Thread Ken Perl
Bob Showalter escreveu (wrote): > > Ken Perl wrote: > > > The password used to access a ftp server is stored in a text file, the > > > perl program gets the password from the file, the pass it to the ftp > > > server for logon, this is the background. > > >

encode base64 password

2005-12-22 Thread Ken Perl
Hi, Is the MIME::Base64 support unicode? I am trying to use the module to encode the a password. In the doc http://support.microsoft.com/default.aspx?scid=kb;en-us;263991 there is one line like this unicodePwd::IgBuAGUAdwBQAGEAcwBzAHcAbwByAGQAIgA= the encoded string is what I want to produce usi

debug code in BEGIN{} block

2006-01-19 Thread Ken Perl
How to debug code in BEGIN{} block? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

import modules at begin block

2006-01-22 Thread Ken Perl
Hi, May I import all modules located in a directory called '/opt/myperlmodules' in Begin block like this? $myModules = "/opt/myperlmodules"; lib->import($myModules); -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

non-lvalue

2006-02-12 Thread Ken Perl
Root cause: Can't modify non-lvalue subroutine call at ... what is the meaning of non-lvalue in the error? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

get rid of "IO::Handle::DESTROY"

2006-02-14 Thread Ken Perl
I am using Apache::DB as interactive debugger to debug my modperl2 program. No breakpoints are defined, I input many 'r' while requesting the home page, and the return is always like below, and the home page can't be displayed in the debug mode. However, if turning off the debug mode, the home pa

:: and ->

2006-02-16 Thread Ken Perl
what is the difference of :: and -> in this statements? $authInstance = Operation::Auth::getInstance($session,$u->authMethod,$u->userId) $authInstance = Operation::Auth->getInstance($session,$u->authMethod,$u->userId) -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

bless $self, $class;

2006-02-17 Thread Ken Perl
what does the statement mean? bless $self, $class; -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

Re: :: and ->

2006-02-18 Thread Ken Perl
This is really very clear. On 2/17/06, Hans Meier (John Doe) <[EMAIL PROTECTED]> wrote: > Ken Perl am Freitag, 17. Februar 2006 02.34: > > what is the difference of :: and -> in this statements? > > > > $authInstance = > > Operation::Auth::getInstanc

print interactive debugging info into a file

2006-02-18 Thread Ken Perl
The "DB::OUT" filehandle is opened to /dev/tty, regardless of where STDOUT may be redirected to, so it's impossible to print the interactive debugging info into a file? I tried 'x @session >/tmp/data' in the debugger and didn't work. -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org

dual core cpu

2006-02-19 Thread Ken Perl
Does perl support dual core cpu(HT) technology? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

Re: dual core cpu

2006-02-20 Thread Ken Perl
ssle you could try and tackle the libs > that perl you are using, rework and recompile, though that is not very > advisable as this will force you to check and do this everytime these libs > are updated. > > Regards, > > Rob > > > On 2/20/06, Owen Cook <[EMAIL PROTECTED]&g

parenthesis after a method

2006-03-09 Thread Ken Perl
I want to put some methods in a POD file synopsis section, which one is correct if a method without a passing in parameter. =head2 generate This function generates a global unique id. or =head2 generate() This function generates a global unique id. any rules? -- perl -e 'print unpack(u,"62V5

match file name at end of a http url

2006-04-25 Thread Ken Perl
If I want to use regular expression to extract the charactors after the last '/' in the url, but below regexpr doesn't work, what I do wrong? $url = 'http://website.com/path/file_name.img'; if (/\/.*$/) { print $url."is matched \n"; } else { print "failed"; } -- perl -e 'print unpack(u,"6

Re: match file name at end of a http url

2006-04-25 Thread Ken Perl
I don't know how to use URI::URI to solve my problem after reading the pod doc. since it is not easy to use regex, I am going to use split '/', $url to extract the last field. On 4/26/06, Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 4/25/06, nishanth ev <[EMAIL PROTECTED]> wrote: > > > if( $url =~