( zamboriz | 2009. 03. 25., sze – 12:54 )

> akkor három darab 1-est kapok a @targets_new tömmbe.

http://perldoc.perl.org/perlop.html#Binding-Operators

"When used in scalar context, the return value generally indicates the success of the operation."

http://perldoc.perl.org/perlretut.html

"If there is a match, s/// returns the number of substitutions made, otherwise it returns false."

http://perldoc.perl.org/perlop.html#Comma-Operator

"In scalar context it evaluates its left argument, throws that value away, then evaluates its right argument and returns that value."

> hogy lehetne "egy művelettel" lecserélni és rögtön be is rakni az új tömbbe a módosított változó értékeket?

Ezek szerint:


  push( @targets_new, scalar( $link=~s/akarmi-.{3, }-$src/-$dst/g, $link ) );

[Nem próbáltam ki.]