Um, there's no difference between putting code into a program and typing it into perl's STDIN yourself. Both are the exact same thing and do the exact same things with your code. Basically the slice appears to be working like the comma operator in scalar context and you're really just doing $array[4] =~ /\S/.
At any rate, you might try something like:
if( 2 == grep /\S/, @array[3..4] ) { stuff(); }
In reply to Re: regexp searches over array slices
by Fletch
in thread regexp searches over array slices
by Reverend Phil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |