in reply to Character class in an array
This is because of array interpolation, which uses the contents of $" to separate array elements when joining them together. You can use this to your advantage by doing something like
Note that this re-localizes $" within a loop, which isn't the most effecient approach, but then again you might not notice the performance difference without a microsocope.@a = ( 'a', 'x', 'z' ); # simplified array while(<>) { local $" = ""; print if(/^[@a]{3}$/); }
|
|---|