Melly has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
In the following script, why does the first attempt to lc @x fail, but the second works?
use strict; use warnings; my @x = qw(A B C); lc($_) for @x; # void warning print @x; # still UC print "\n"; s/(\w*)/lc($1)/e for @x; # why no void warning here? print @x; # LC - it worked
Tom Melly, pm (at) cursingmaggot (stop) co (stop) ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing arrays w/ and w/o regex
by Corion (Patriarch) on Nov 09, 2021 at 12:25 UTC | |
|
Re: Changing arrays w/ and w/o regex
by ikegami (Patriarch) on Nov 09, 2021 at 13:31 UTC |