Perl: the Markov chain saw | |
PerlMonks |
Re: combine arrays, duh!by Marshall (Canon) |
on Apr 20, 2011 at 23:45 UTC ( [id://900444]=note: print w/replies, xml ) | Need Help?? |
When you post code here, please show the actual code and the actual output. I had to guess a bit as to what you had...
grep{} is a filtering operation. It doesn't modify anything. /^\n*$/ means: a string that may have zero or more \n characters, but no other characters - a pretty "rare duck"; perhaps a null string, "". When you negate that with the !, it means that for each item in @EuserADgrps, transfer it to @E if it is not one of these "rare ducks". I suspect that this grep{} does nothing to your actual data. Use @X=map{..blah..;$_}@Y; to transform a Y into an X. But I don't think that you need that here either. The chomp() function will remove trailing "new lines" from a string, or you can also use chomp() on an array. chomp(@x) will modify @x. So if you don't want that, make a copy: @y=@x; chomp(@y);#See below:
In Section
Seekers of Perl Wisdom
|
|