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]
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/