Hey Everybody, Thanks again.
I just have a quick question. When you do the CRLF count (for windows files) using a match with the binding operator, why is the $crlf variable set to () first? Thanks, Tiago On Sun, Feb 24, 2013 at 8:13 AM, *Shaji Kalidasan* <shajiin...@yahoo.com>wrote: > Greetings, > > Thank you very much for your suggestions and alternatives Dr. Ruud. > > It is greatly appreciated. > > best, > Shaji > > ------------------------------------------------------------------------------- > Your talent is God's gift to you. What you do with it is your gift back to > God. > > ------------------------------------------------------------------------------- > > > ________________________________ > From: Dr.Ruud <rvtol+use...@isolution.nl> > To: beginners@perl.org > Sent: Sunday, 24 February 2013 4:51 PM > Subject: Re: Line Endings > > On 2013-02-23 01:51, *Shaji Kalidasan* wrote: > > > my $cr = $content =~ tr/\r/\r/; > > my $lf = $content =~ tr/\n/\n/; > > my $crlf = $content =~ s/\r\n/\r\n/g; > > See also 'perldoc -q count'. > > Alternatives: > > my $cr = $content =~ tr/\r//; > my $lf = $content =~ tr/\n//; > my $crlf =()= $content =~ /\r\n/g; > > -- Ruud > > > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > -- "Education is not to be used to promote obscurantism." - Theodonius Dobzhansky. "Gracias a la vida que me ha dado tanto Me ha dado el sonido y el abecedario Con él, las palabras que pienso y declaro Madre, amigo, hermano Y luz alumbrando la ruta del alma del que estoy amando Gracias a la vida que me ha dado tanto Me ha dado la marcha de mis pies cansados Con ellos anduve ciudades y charcos Playas y desiertos, montañas y llanos Y la casa tuya, tu calle y tu patio" Violeta Parra - Gracias a la Vida Tiago S. F. Hori. PhD. Ocean Science Center-Memorial University of Newfoundland