Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: remove lines from file ending with / char

by choroba (Canon)
on Sep 03, 2012 at 13:14 UTC ( #991431=note: print w/ replies, xml ) Need Help??


in reply to remove lines from file ending with / char

Please, give us more information: Is it possible for a directory to be mentioned once with no content, but later with a file, like this?

/foo/bar/ /foo/bar/baz
Or only the "empty" directories can be listed without files. If so, you can just use
grep { 0 != index reverse($_), '/' } @files
or
grep !m{/$}, @files
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: remove lines from file ending with / char
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991431]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-07-07 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls