|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: question regarding slicesby duct_tape (Hermit) |
| on Nov 06, 2003 at 13:46 UTC ( [id://305115]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I can't think of how to do this, since it is a list instead of an array... it might not be possible. With lists you can use -1 to get the last element, but 2 .. -1 doesn't seem to work. What about using grep to avoid the check for . and .. within the foreach?
I know this isn't what you asked for, but it is another solution. Personally I prefer having the check within the foreach loop like this: next if (/^\.\.?$/);Hope that helps.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||