in reply to Remove from character to end of line
while(<>) { s#^([^/]+).*#$1#; print; }
hope this helps,
Update: even if the s/// works, split() is faster:
while(<>) { print((split '/')[0], "\n"); }
Update: ++Abigail-II. I need to work on my golfing skills... ;)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Remove from character to end of line
by Abigail-II (Bishop) on Aug 01, 2002 at 16:56 UTC | |
by sdyates (Scribe) on Aug 01, 2002 at 17:12 UTC |