Am Dienstag, 24. Mai 2005 19.22 schrieb Robert Citek: > I found a variation of this in the Perl Nutshell book: > > $ perl -le ' > $foo="fee fie foe foo" ; > while ($foo =~ m/e/g ) { > push @bar, pos $foo ; > } > print join(":", @bar); ' > 2:3:7:11 > > Is there an equivalent way to do the same using map instead of an > explicit while loop? I'm guessing not,
I guess the same (did nevertheless some tests without luck) > since map is expecting a list and not a scalar, which $foo is. but have a slightly different argument: map expects a list that is already created, while pos() has to be applied after every step of creating the list. But how knows? (Awaiting for the inconceivable of one of the list gurus) joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>