We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
G'day Lady Aleena, Without knowing the exact contents of @big_images and @cross_files, or what transformation occurs when textify() is run, it's not possible to give a direct answer. As a first step, I recommend you print those values inside delimiters to identify parts of the string that may not be immediately obvious. For example, these may appear the same when printed directly:
With delimiters, the difference is obvious:
Doing this may highlight the problem and allow you to solve it yourself. If not, post the results and we can have another look at it. You're reading the entirety of @big_images in every iteration of the for loop. A slightly more efficient way would be to only read as much as you need: see the List::Util function first. Not reading that array at all inside the for loop would be much better; something like:
Note: Testing $opt{big} for truth may be an issue. If --big (I'm guessing at the option) isn't supplied, will the key, big, be absent or will it have an empty arrayref ([]) as its value? If it's an empty arrayref, the value (something like ARRAY(0xhhhhhhhh)) will always be true and a better test would be 0+@{$opt{big}}.
However, if the key is absent, a better test would be exists($opt{big}). Depending on other code not shown, a combination of both of those (exists($opt{big}) && 0+@{$opt{big}}) may be even better. — Ken In reply to Re: How do I get an exclusion with grep?
by kcott
|
|