[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] Multiple Substitution



At 16.55 -0400 1999.05.05, Mark Yannuzzi wrote:
>print OUTFILE (($label[$i] =~ s/\(([^]]+)\):/ [$1]/), "\t");
>
>which prints integers instead...I have just learned that is because
>substitution returns the number of substitutions performed.

If you are determined to put it into one statement, you can, but it gets
more uglier.  One way:

  print OUTFILE (($label[$i] =~ s/\(([^[]+)\):/ [$1]/, $label[$i])[-1], "\t");

But I would never recommend such a thing.  :)

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org