Re: Question about split

2009-10-23 Thread John W. Krahn
sanket vaidya wrote: Hi, Hello, Consider the code below: use warnings; use strict; my $string = '100955 BLow-Gomez,Joseph MMEX.AMER. QHUTC012'; my ($id) = split(/\s/,$string); print "id = $id"; Output: 100955 Now remove brackets surrounding $id like as under: use warnings; use strict;

RE: Question about split

2009-05-27 Thread sanket vaidya
-Original Message- From: Chas. Owens [mailto:chas.ow...@gmail.com] Sent: Wednesday, May 27, 2009 4:52 PM To: sanket vaidya Cc: beginners@perl.org Subject: Re: Question about split On Wed, May 27, 2009 at 06:45, sanket vaidya wrote: > Hi all, > > Kindly look at the code below

Re: Question about split

2009-05-27 Thread Chas. Owens
On Wed, May 27, 2009 at 06:45, sanket vaidya wrote: > Hi all, > > Kindly look at the code below: > > use warnings; > use strict; > > $_ = 'Welcome to openSUSE 11.0 (X86-64) - Kernel \r (\l).'; > > my @numbers = split /\D+/; snip > Why the first element of @numbers is 'blank'? Kindly explain with e