You need to escape spaces in a glob spec unless you want them to be treated as pattern seperator.
>perl -le"print for glob '*.jpg *.gif'" a.jpg b.jpg c.gif >perl -le"print for glob 'C:/Documents and Settings/*'" C:/Documents and >perl -le"print for glob 'C:/Documents\ and\ Settings/*'" C:/Documents and Settings/All Users C:/Documents and Settings/Default User C:/Documents and Settings/ikegami C:/Documents and Settings/kaijugal C:/Documents and Settings/LocalService C:/Documents and Settings/NetworkService
Alternatively, use bsd_glob from File::Glob.
>perl -le"use File::Glob qw( bsd_glob ); print for bsd_glob 'C:/Docume +nts and Settings/*'" C:/Documents and Settings/All Users C:/Documents and Settings/Default User C:/Documents and Settings/ikegami C:/Documents and Settings/kaijugal C:/Documents and Settings/LocalService C:/Documents and Settings/NetworkService
In reply to Re: Delete files with Perl in Windows
by ikegami
in thread Delete files with Perl in Windows
by whnwhrwhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |