Re: split()'s pattern argument
- From: usenet@xxxxxxxxxxxxxxx
- Date: 30 Mar 2006 12:57:23 -0800
Jerry Adair wrote:
to split(), it just so happens that the first line of data begins with a
space, followed by two "words" that are separated by whitespace. So the
list that I get back from split() has 3 elements in it
If all you want to do is split $_ on whitespace ignoring any leading
whitespace the you can simply say "split". Observe:
#!/usr/bin/perl
use warnings; use strict;
$_ = ' foo bar ';
my @array = split;
print map {"'$_'\n"} @array;
__END__
--
http://DavidFilmer.com
.
- Follow-Ups:
- Re: split()'s pattern argument
- From: Jerry Adair
- Re: split()'s pattern argument
- References:
- split()'s pattern argument
- From: Jerry Adair
- split()'s pattern argument
- Prev by Date: Re: Find duplicates in a dat file
- Next by Date: Re: split()'s regex pattern parameter
- Previous by thread: Re: split()'s pattern argument
- Next by thread: Re: split()'s pattern argument
- Index(es):
Relevant Pages
|