subroutine reference for a class member

2006-06-19 Thread Alex
Hello, Maybe someone could please tell me how can I acquire a subroutine reference for a class member? Basically I need this reference to pass as a parameter for curl's setopt function: $this->{curl}->setopt(CURLOPT_HEADERFUNCTION, reference to header_function); class al

Re: unscrambler speedup rewrite

2006-06-19 Thread Chad Perrin
On Mon, Jun 19, 2006 at 11:54:46PM -0400, Jeremy Kister wrote: > I wrote a word descrambler that works very well, but is very slow > compared to http://www.jumble.org Whew. Judging by the subject line, I was worried this was going to turn out to be spam. -- CCD CopyWrite Chad Perrin [ http://c

Re: unscrambler speedup rewrite

2006-06-19 Thread Jeremy Kister
On 6/19/2006 11:54 PM, Jeremy Kister wrote: I wrote a word descrambler that works very well, but is very slow compared to http://www.jumble.org already found a very important piece that I missed ($lfound).. while(1){ print "word: "; chop(my $scramble = ); $scramble =~ s

unscrambler speedup rewrite

2006-06-19 Thread Jeremy Kister
I wrote a word descrambler that works very well, but is very slow compared to http://www.jumble.org I'm wondering how others could write to code so that it'd find words faster. #useful with dictionary from http://wordlist.sourceforge.net/ use strict; my %dictionary; opendir(DIR, "$ENV{'HOME'

Re: using (sharing) variables between perl files

2006-06-19 Thread Jeff Peng
The "best" way to do it in your case will vary, depending on what exactly you're doing with your Perl scripts. I do agree that.If you develop large programs where multi-processes should share some variables (including scalar,array or hash),you could use DB_File or other database to store

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Xavier Noria
On Jun 19, 2006, at 22:45, Anthony Ettinger wrote: # order matters $raw_text =~ s/\015\012/\n/g; $raw_text =~ s/\012/\n/g unless "\n" eq "\012"; $raw_text =~ s/\015/\n/g unless "\n" eq "\015"; Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/ g ? The regexp i

Re: newlines on win32, old mac, and unix

2006-06-19 Thread John W. Krahn
Anthony Ettinger wrote: > On 6/19/06, John W. Krahn <[EMAIL PROTECTED]> wrote: >> Anthony Ettinger wrote: >> >># order matters >> >>$raw_text =~ s/\015\012/\n/g; >> >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012"; >> >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015"; >> > >> > Does

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
On 6/19/06, John W. Krahn <[EMAIL PROTECTED]> wrote: Anthony Ettinger wrote: >># order matters >>$raw_text =~ s/\015\012/\n/g; >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012"; >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015"; > > Does it make any difference if I use s/\cM\cJ/cJ/

Re: newlines on win32, old mac, and unix

2006-06-19 Thread John W. Krahn
Anthony Ettinger wrote: >># order matters >>$raw_text =~ s/\015\012/\n/g; >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012"; >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015"; > > Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g ? The string "cJ" in your example

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
# order matters $raw_text =~ s/\015\012/\n/g; $raw_text =~ s/\012/\n/g unless "\n" eq "\012"; $raw_text =~ s/\015/\n/g unless "\n" eq "\015"; Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g ? Since the newline convention is not necessarily the one in the r

Re: using (sharing) variables between perl files

2006-06-19 Thread Chad Perrin
On Mon, Jun 19, 2006 at 05:02:33PM +0200, Varga Pavol wrote: > Hi, > may be very simple, but I don't understand well how to simple use (share) > varables between perl files? > I have (very) big perl script and I would like to divide it into more small > scripts to make it all more transparent. > Or

Re: using (sharing) variables between perl files

2006-06-19 Thread Anthony Ettinger
On 6/19/06, Prabu <[EMAIL PROTECTED]> wrote: Varga Pavol wrote: > Hi, > may be very simple, but I don't understand well how to simple use (share) > varables between perl files? > I have (very) big perl script and I would like to divide it into more small > scripts to make it all more transparent.

Re: using (sharing) variables between perl files

2006-06-19 Thread Prabu
Varga Pavol wrote: Hi, may be very simple, but I don't understand well how to simple use (share) varables between perl files? I have (very) big perl script and I would like to divide it into more small scripts to make it all more transparent. Or, how to use one @array or one $array_ref for more t

Re: using (sharing) variables between perl files

2006-06-19 Thread M. Kristall
Varga Pavol wrote: Hi, Hello may be very simple, but I don't understand well how to simple use (share) varables between perl files? I have (very) big perl script and I would like to divide it into more small scripts to make it all more transparent. perldoc is your friend. If you have separate '

using (sharing) variables between perl files

2006-06-19 Thread Varga Pavol
Hi, may be very simple, but I don't understand well how to simple use (share) varables between perl files? I have (very) big perl script and I would like to divide it into more small scripts to make it all more transparent. Or, how to use one @array or one $array_ref for more than one file.pl? I j