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

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

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

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. Or,

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, how

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 runtime

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 is completely

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/ vs. s/\015\012/\n/g

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 it make any difference if I use

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 is OK,

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

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,

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 = STDIN); $scramble