Re: Substitution Problem

2010-06-28 Thread Chas. Owens
On Mon, Jun 28, 2010 at 19:48, John W. Krahn wrote: snip > s/\((\d+)\)/($1)/g; snip Since Perl 5.8.0, \d does not mean [0-9], it means any character that is classified as a digit in Unicode. In Perl 5.12.1, there are five hundred seventy-seven characters that will match \d. If it is your intent

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread Chas. Owens
On Mon, Jun 28, 2010 at 17:08, marcos rebelo wrote: snip >> The "code block" in your example is not a "closure". >> >> perldoc -q closure >> http://en.wikipedia.org/wiki/Closure_(computer_science) >> > > The closure in here was on propose, even if in this case isn't a closure. snip Why are you pu

Re: Substitution Problem

2010-06-28 Thread Steve Bertrand
On 2010.06.28 20:39, jimston...@aol.com wrote: > > In a message dated 6/28/2010 7:49:47 P.M. Eastern Daylight Time, > jwkr...@shaw.ca writes: > > jimston...@aol.com wrote: >> >> can anyone give me some help on a perl program to change a file of mine. >> The string is: >> >> $_ = "from ''ala

Re: Substitution Problem

2010-06-28 Thread Jimstone77
In a message dated 6/28/2010 7:49:47 P.M. Eastern Daylight Time, jwkr...@shaw.ca writes: jimston...@aol.com wrote: > > can anyone give me some help on a perl program to change a file of mine. > The string is: > > $_ = "from ''alam' (481) or possibly (in the sense of dumbness); > solitary;

Re: Substitution Problem

2010-06-28 Thread John W. Krahn
jimston...@aol.com wrote: can anyone give me some help on a perl program to change a file of mine. The string is: $_ = "from ''alam' (481) or possibly (in the sense of dumbness); solitary; Ulam, the (6155) name of two Soldiers;--Ulam." Where each line is $_ I'm trying to substitute a hyperli

Re: Substitution Problem

2010-06-28 Thread John W. Krahn
jimston...@aol.com wrote: can anyone give me some help on a perl program to change a file of mine. The string is: $_ = "from ''alam' (481) or possibly (in the sense of dumbness); solitary; Ulam, the (6155) name of two Soldiers;--Ulam." Where each line is $_ I'm trying to substitute a hyperli

Re: Substitution Problem

2010-06-28 Thread Jimstone77
can anyone give me some help on a perl program to change a file of mine. The string is: $_ = "from ''alam' (481) or possibly (in the sense of dumbness); solitary; Ulam, the (6155) name of two Soldiers;--Ulam." Where each line is $_ I'm trying to substitute a hyperlink for each NUMBER tha

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread marcos rebelo
On Sun, Jun 27, 2010 at 11:55 PM, John W. Krahn wrote: > marcos rebelo wrote: >> >> Hi all > > Hello, > >> This time, it's much more a personal opinion than a recipe. >> >> >> http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/04---misc/01-when-shall-we-use-default-variables > > S

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread Shawn H Corey
On 10-06-28 10:15 AM, Shlomi Fish wrote: You seem to have an obsession with getting people to stop using "my $param = shift;" and use "my $param = shift(@_);" instead. This is depsite the fact that a lot of high-quality, production code on CPAN and elsewhere is using it extensively. We already ha

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread marcos rebelo
This will becoming a never ending story. In my opinion, documentation shall be done before writing the code. When I'm not to lazy and I do documentation, I set it before the subroutine definition. Usually, at a precise moment, I'm looking to the documentation or to the code, hardly I need both at

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread Randal L. Schwartz
> "marcos" == marcos rebelo writes: marcos> I think that I didn't opposed myself to the pattern: marcos> sub xpto { marcos> my $var1 = shift; marcos> my $var2 = shift; marcos> ... marcos> } marcos> Where it is clear that you wont to assign the parameters. 90% of the marcos> times

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread marcos rebelo
I think that I didn't opposed myself to the pattern: sub xpto { my $var1 = shift; my $var2 = shift; ... } Where it is clear that you wont to assign the parameters. 90% of the times I prefer to have pattern sub xpto { my ($var1, $var2) = @_; ... } since, in my opinion, makes

Re: One new Recipe has arrived: When shall we use default variables?

2010-06-28 Thread Shlomi Fish
Hi Shawn, On Sunday 27 Jun 2010 20:41:31 Shawn H Corey wrote: > On 10-06-27 01:08 PM, marcos rebelo wrote: > > Hi all > > > > This time, it's much more a personal opinion than a recipe. > > > > http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/04--- > > misc/01-when-shall-we-us

Re: AW: Multi page form - cgi

2010-06-28 Thread Shlomi Fish
On Monday 28 Jun 2010 13:55:56 Thomas Bätzler wrote: > Herb asked: > > I've been working on putting together a multi-page form in a single > > perl script. I have everything working as a single page form (writing > > to mysql database and emailing the output upon submit) but have not > > had any

AW: Multi page form - cgi

2010-06-28 Thread Thomas Bätzler
Herb asked: > I've been working on putting together a multi-page form in a single > perl script. I have everything working as a single page form (writing > to mysql database and emailing the output upon submit) but have not > had any luck breaking the form into multiple pages. As mentioned > bef

Re: Multi page form - cgi

2010-06-28 Thread Herb
Hi, I've been working on putting together a multi-page form in a single perl script. I have everything working as a single page form (writing to mysql database and emailing the output upon submit) but have not had any luck breaking the form into multiple pages. As mentioned before, I'm not an ev

Re: Edit large data file

2010-06-28 Thread Robert Citek
2010/6/26 Jenda Krynicky : > From: mrwawa >> That is correct.  I decided to just write the output to a separate >> file and then delete the original file.  Thanks for all your help. >> >> Wade > > That's all you can do. If you just wanted to change a few characters > you could open the file for re