Re: Removing a space from file name

[email protected] (Smoot Carl-Mitchell via beginners)
Newsgroups perl.beginners
Message-ID <[email protected]>
On Thu, 2025-02-20 at 08:01 +0800, walt via beginners wrote:
> > 
> > Something like:
> > 
> > while (<*>) {
> > 	rename $_, "$1$2.jpg" if $_ =~ /(.+) (.+)\.jpg/;
> > }
> > 
> 
> what does <*> mean here?

<*> iterates over the current directory and returns every filename in
the directory to the $_ variable. The '*" can be any glob pattern. e.g.
for the specific jpg files in the example, I could have used <*.jpg>
-- 
Smoot Carl-Mitchell
System/Network Architect
voice: +1 480 922-7313
cell: +1 602 421-9005
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.