TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:18790] quick way to strip spaces...





> From: "Eric Hillman" <ehillman@cccu.com>
> Reply-To: tclug-list@mn-linux.org
> Date: Fri, 9 Jun 2000 14:57:03 -0500
> To: <tclug-list@mn-linux.org>
> Subject: RE: [TCLUG:18790] quick way to strip spaces...
>
> 
> perl -e 'opendir D, "."; for(readdir D) {$x=$_; s/\s+/_/g; rename $x, $_;}'
>

Heh...this worked for me!!!...

However, I'm wondering if you could explain this bit for me...

{$x=$_; s/\s+/_/g; rename $x, $_;}

I also am going to need to strip out '(' and ')', and I'm not seeing how to
do that.  

Better yet, if you could point me in the right direction as to where to look
for this solution on my own, I'd be happy to go digging....I'm afraid perl
is not yet part of my toolchest...

Thanks

Brian