Re: chomp () function

2010-08-29 Thread Jim Gibson
At 8:17 PM +0530 8/29/10, Kaushal Shriyan wrote: I am referring to http://www.perl.org/books/beginning-perl/. so I am planning to read upto chapter 10. is it recommended to even go beyond chapter 10. Please suggest. I have not read that online resource, but looking at the contents I would re

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
On Sun, Aug 29, 2010 at 7:58 PM, Chas. Owens wrote: > On Sun, Aug 29, 2010 at 09:41, Kaushal Shriyan > wrote: > snip >> Thanks a lot Chas. Understood now. >> Also what does $_ default variable means exactly, any example would >> really help me understand it > snip > > The default variable is set

Re: chomp () function

2010-08-29 Thread Chas. Owens
On Sun, Aug 29, 2010 at 09:41, Kaushal Shriyan wrote: snip > Thanks a lot Chas. Understood now. > Also what does $_ default variable means exactly, any example would > really help me understand it snip The default variable is set or read by many Perl 5 functions. For instance, if you use the rea

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
On Sun, Aug 29, 2010 at 7:06 PM, Chas. Owens wrote: > On Sun, Aug 29, 2010 at 09:23, Kaushal Shriyan > wrote: >> On Sun, Aug 29, 2010 at 6:11 PM, Chas. Owens wrote: >>> On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan >>> wrote: Hi Can someone please explain me with an example of

Re: chomp () function

2010-08-29 Thread Chas. Owens
On Sun, Aug 29, 2010 at 09:23, Kaushal Shriyan wrote: > On Sun, Aug 29, 2010 at 6:11 PM, Chas. Owens wrote: >> On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan >> wrote: >>> Hi >>> >>> Can someone please explain me with an example of the usage chomp () >>> builtin function in perl. >> snip >> >>

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
On Sun, Aug 29, 2010 at 6:11 PM, Chas. Owens wrote: > On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan > wrote: >> Hi >> >> Can someone please explain me with an example of the usage chomp () >> builtin function in perl. > snip > > The chomp function removes whatever is in the $/ variable from the

Re: chomp () function

2010-08-29 Thread Chas. Owens
On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan wrote: > Hi > > Can someone please explain me with an example of the usage chomp () > builtin function in perl. snip The chomp function removes whatever is in the $/ variable from the argument passed in (or $_ if no argument is passed in). The defau

Re: chomp () function

2010-08-29 Thread Shlomi Fish
On Sunday 29 August 2010 14:15:52 Kaushal Shriyan wrote: > Hi > > Can someone please explain me with an example of the usage chomp () > builtin function in perl. Yes, here you go. Let's suppose you want to write a small grep programs that only prints all lines ending with the character "\". You