--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> Mr. Shawn H. Corey wrote: > > On Tue, 2006-09-05 at 01:33 +0200, Paul Johnson > wrote: > >>Um, that's not quite correct. > >> > >>See `perldoc -f split` for details. > > > > Oh, yes, a special case. I have long ago abandoned > special cases since > > they lead to errors. Note that `perldoc -f split` > starts with: > > > > split /PATTERN/,EXPR,LIMIT > > split /PATTERN/,EXPR > > split /PATTERN/ > > split > > > > Note: no strings. Strings do not work well when > used as the pattern for > > split. > > Anything used as a pattern is a string. See the > "Quote and Quote-like > Operators" section of perlop: > > perldoc perlop > > > $ perl -le' > my $string = q[ a b c d ]; > print join "\t", map "<$_>", split q[\s+], > qq[$string], q[4]; > print join "\t", map "<$_>", split /\s+/, > $string, 4; > ' > <> <a> <b> <c d > > <> <a> <b> <c d > > > $ perl -le' > my $w = 3; > my $x = 7; > my $y = 2; > my $z = 6; > > print join "\t", map "<$_>", split $w * $x - $y * > $z, q[one] . ( $w + $z ) . > q[two] . ( $x + $y ) . q[three]; > ' > <one> <two> <three> > > > > > John split /PATTERN/,EXPR,LIMIT split /PATTERN/,EXPR split /PATTERN/ split 1. I check the perldoc -f split but I am not quite sure what EXPR really means. Does it refer to a string, or a scalar variable contaning a string, or an array? From what I learn from camel book I don't find an example that shows "split" can work on an array. But it works fine for my array transition. Am I missing something? 2. In this line $ perl -le what does -le mean? Thanks, Li __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>