Re: $_ and split function...

2005-07-16 Thread John W. Krahn
Vineet Pande wrote: > Hi Hello, > In the following code > > > #!/usr/bin/perl > use warnings; > use strict; > > my $found = 0; > $_ = "Nobody wants to hurt you... 'cept, I do hurt people sometimes, > Case."; > > my $sought = "peo

RE: $_ and split function...

2005-07-16 Thread Moon, John
To: beginners@perl.org Subject: $_ and split function... Hi In the following code #!/usr/bin/perl use warnings; use strict; my $found = 0; $_ = "Nobody wants to hurt you... 'cept, I do hurt people sometimes, Case.&quo

$_ and split function...

2005-07-16 Thread Vineet Pande
Hi In the following code #!/usr/bin/perl use warnings; use strict; my $found = 0; $_ = "Nobody wants to hurt you... 'cept, I do hurt people sometimes, Case."; my $sought = "people"; foreach my $word (split) { if ($word eq $sought