Auto correction of typos

2011-03-04 Thread Ramprasad Prasad
I have a web form where people sign up for updates by filling in their email address A lot of users end up not receiving the confirmation mailer because of typos in the email id Like yhaoo.com or hotmaill.com I would like to prompt the user for a possible typo , like the google "Did you mean this

Re: yaml file conversion

2011-03-04 Thread Uri Guttman
> "JG" == Jim Green writes: JG> Thanks Brandon, YAML should get some functions to manipulate it.. that doesn't make sense. yaml and other serializers don't manipulate data. they convert in memory data to a string format that can be saved, printed, send on a socket, transfered between langu

Re: yaml file conversion

2011-03-04 Thread Uri Guttman
> "JG" == Jim Green writes: JG> On Thu, Mar 3, 2011 at 6:31 PM, Jim Gibson wrote: >> On 3/3/11 Thu  Mar 3, 2011  3:11 PM, "Jim Green" >> scribbled: >> >>> On Mar 3, 5:44 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: On 11-03-03 05:40 PM, Jim Green wrote: >

Class::Struct comparison & MOP

2011-03-04 Thread Sam Steingold
1 How do I compare Class::Struct instances (objects) for equality (or precedence)? E.g., use Class::Struct MyStruct => [foo => '$', bar => '$', baz => '$']; my MyStruct $a = MyStruct->new(foo => "a"); my MyStruct $b = MyStruct->new(bar => "b"); my MyStruct $a1 = MyStruct->new(foo => "a

Class::Struct comparison & MOP

2011-03-04 Thread Sam Steingold
1 How do I compare Class::Struct instances (objects) for equality (or precedence)? E.g., use Class::Struct MyStruct => [foo => '$', bar => '$', baz => '$']; my MyStruct $a = MyStruct->new(foo => "a"); my MyStruct $b = MyStruct->new(bar => "b"); my MyStruct $a1 = MyStruct->new(foo => "a

Re: yaml file conversion

2011-03-04 Thread Jim Green
Thanks Brandon, YAML should get some functions to manipulate it.. On Thu, Mar 3, 2011 at 7:56 PM, Brandon McCaig wrote: > On Thu, Mar 3, 2011 at 6:39 PM, Brandon McCaig wrote: >> I don't know if I'd call it easier. I'm not personally familiar with >> YAML so I only bothered to parse the example

Re: yaml file conversion

2011-03-04 Thread Jim Green
On Thu, Mar 3, 2011 at 6:31 PM, Jim Gibson wrote: > On 3/3/11 Thu  Mar 3, 2011  3:11 PM, "Jim Green" > scribbled: > >> On Mar 3, 5:44 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: >>> On 11-03-03 05:40 PM, Jim Green wrote: >>> But is there a easier way of doing this I might not be aw

Re: AW: Testing File Contents

2011-03-04 Thread Dr.Ruud
On 2011-03-02 19:22, Christian Marquardt wrote: open CFG, '<', $_file || die("could not open file: $_file!"); That only dies if $_file is false. Funny that you did use parentheses with die. Some '$' characters were missing too: open my $CFG, '<', $_file or die "Error opening '$_file'

Re: multidimensional array check

2011-03-04 Thread Shawn H Corey
On 11-03-04 05:01 PM, Brian F. Yulga wrote: "bless REF This function tells the thingy referenced by REF that it is now an object in the CLASSNAME package. ..." 'thingy' is a great technical term. ;-) Yes, Perl is the only language where you can bless your thing

Re: multidimensional array check

2011-03-04 Thread Brian F. Yulga
Shawn H Corey wrote: On 11-03-04 02:30 PM, Brian F. Yulga wrote: > my brain nearly exploded when reading the section "returning a > subroutine from a subroutine" Just wait until you get to the part where you can treat an anonymous subroutine as an object. :D For details, see `perldoc -f b

Re: multidimensional array check

2011-03-04 Thread Shawn H Corey
On 11-03-04 02:30 PM, Brian F. Yulga wrote: my brain nearly exploded when reading the section "returning a subroutine from a subroutine" Just wait until you get to the part where you can treat an anonymous subroutine as an object. :D For details, see `perldoc -f bless`. -- Just my 0.0

Re: multidimensional array check

2011-03-04 Thread Brian F. Yulga
Thanks for the link. That's exactly the explanation I was looking for... I progressed quickly through the first Oreilly book (Learning Perl) but slowed down considerably in the 2nd (Intermediate Perl). I found the chapter on Subroutine References (7) more difficult than earlier material (my

Re: multidimensional array check

2011-03-04 Thread Jim Gibson
On 3/4/11 Fri Mar 4, 2011 10:30 AM, "Brian F. Yulga" scribbled: > Coming from a basic understanding of C, the reference variable concept > sounds a lot like pointers in C. But, my "Learning Perl" and > "Intermediate Perl" books do not use that terminology. Am I on a > correct path to understa

Re: multidimensional array check

2011-03-04 Thread Rob Coops
You are very right a really nice explanation of this you can find in the "Advanced Perl Programming" book by Oreilly see the link below http://oreilly.com/catalog/advperl/excerpt/ch01.html If you already went trough the other two then this is definitely a good one to read as it goes that extra st

Re: Class::Struct comparison & MOP

2011-03-04 Thread Shlomi Fish
Hi Sam, welcome aboard. On Friday 04 Mar 2011 18:47:40 Sam Steingold wrote: > 1 How do I compare Class::Struct instances (objects) > for equality (or precedence)? > > E.g., > > use Class::Struct MyStruct => > [foo => '$', >bar => '$', >baz => '$']; > > my MyStruct $a = MyStruct->ne

Re: multidimensional array check

2011-03-04 Thread Brian F. Yulga
Rob Coops wrote: So you should now be able to retrieve the whole result set as a reference to an array containing references to arrays. And I hope that my ramblings explained a bit how you can use that reference to get to the underlying values. If you combine all of that I think you'll be

Re: File::Basename problem

2011-03-04 Thread Rob Dixon
On 04/03/2011 16:48, Téssio Fechine wrote: > >> De: Shawn H Corey wrote: > >> my ( $file, $dir, $sufix ) = fileparse( $item, %sufixTable ); >> >> I don't think fileparse takes a hash as the final >> arguments. It would be converted to an array and both >> the keys and the values used. >> >>

Re: multidimensional array check

2011-03-04 Thread Rob Coops
You are now talking about the finer points of the DBI module... :-) The simplest way of doing what you want is this: my $tbl_ary_ref = $query_handle->fetchall_arrayref; Here though you will need a bit of background as this does exactly what you are looking for but with a twist. I'll try to expla

Re: File::Basename problem

2011-03-04 Thread Téssio Fechine
Can't I use the hash in list context with something like itsNotRegex(%sufixTable) ? I use this hash in a program that find related suffix to know if a file has a source ('.o' => '.c').. and keeping the list of suffixes in another is variable is a kind of rework. Thanks for the help! > De: Sha

Class::Struct comparison & MOP

2011-03-04 Thread Sam Steingold
1 How do I compare Class::Struct instances (objects) for equality (or precedence)? E.g., use Class::Struct MyStruct => [foo => '$', bar => '$', baz => '$']; my MyStruct $a = MyStruct->new(foo => "a"); my MyStruct $b = MyStruct->new(bar => "b"); my MyStruct $a1 = MyStruct->new(foo => "a

Re: File::Basename problem

2011-03-04 Thread Shawn H Corey
On 11-03-04 11:14 AM, Téssio Fechine wrote: my ( $file, $dir, $sufix ) = fileparse( $item, %sufixTable ); I don't think fileparse takes a hash as the final arguments. It would be converted to an array and both the keys and the values used. Also, from `perldoc File::basename`: If @s

File::Basename problem

2011-03-04 Thread Téssio Fechine
Hello! I'm trying to use File::Basename, but it is not behaving well: tessio@pacman:~/tmp/ASAP$ ls book.div book.tex erotic.div erotic.tex erotyc.tex problem source.a source.c source.o tessio@pacman:~/tmp/ASAP$ cat problem use 5.010; use strict; use warnings; use File::Basename;

Re: multidimensional array check

2011-03-04 Thread mammoccio
Il 04/03/2011 13:26, Rob Coops ha scritto: First of all, really tnx Rob! I really appreciate u way to teach (even to folks with no programming background like me) the logic behind! I know that maybe this is a silly question but how can I transform the my @G1 = (["alfa" , "10"], ["beta" , "11"

Re: multidimensional array check

2011-03-04 Thread Rob Coops
Hi Vito, Ok so lets give this a try... First lets deal with comparing the arrays then we can get to the size issues and memory usage etc... You have the data in an array which is good but not all that nice as after all it will make for a lot of work if you want to compare two arrays (you end up

Re: yaml file conversion

2011-03-04 Thread Rob Dixon
On 03/03/2011 22:40, Jim Green wrote: Hello: I have a yaml file key1: a: value1 b: value1 key2: a: value2 b: value2 I want it converted to a: key1:value1 key2:value2 b: key1:value1 key2:value2 I could use YAML module to load the first yaml file to a hash and ma

Re: multidimensional array check

2011-03-04 Thread mammoccio
> You haven't told us enough to understand the problem. You are right as i said before i wasn't really clear.. > > Are 'x', 'y', and 'table' different in each case perhaps? Yes > If so then you must explain in detail what you mean by 'check > against'. It is likely > that any comparison between

Re: multidimensional array check

2011-03-04 Thread mammoccio
First of all, thank for u support! Really ! > The most efficient way would be to arrange to have the Oracle database > engine do most of the comparisons. I am not enough of a database expert to > recommend ways to do this. I agree with u , but it's something that is not possible without a dblink,