Re: s/// w/o intermediate variables?
Georg Moritz <[email protected]>
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
Hello kynn - and all,
[..]
> what you require is a modifier for the s/// operator (perhaps 'r') which
> makes s/// return the transformed string as a result rather than the
> number of occurences of the pattern, assigning the value of a variable to
number of substitutions
> a local $_ (for the s/// operator to work with) and storing the result in
> a kin of the builtins $_,$',$` and $& - let's assume $§:
sorry about that. I almost always begin to get scrupulous with mails I
actually sent, as with programs I wrote... :)
greets,
georg
--
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s,/,($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e,e && print}