I am trying to execute the following command:
perl -pi -e 's,vaadin-element,color-picker,g' *.* demo/* test/* src/* theme/*/*
(following this document)
Unfortunately it seems that the window distribution of pearl I use has some issues with the command, as I get the following error:
Can't open *.*: Invalid argument.
Can't open demo/*: Invalid argument.
Can't open test/*: Invalid argument.
Can't open src/*: Invalid argument.
Can't open theme/*/*: Invalid argument.
Any suggestions on how to fix that? Thank you in advance!
Disclaimer: I never used pearl before and have absolutely no experience.
In Unix-derived operating systems, the shell expands globs like
*.*
, and provides the command line as an array of strings to the program.In Windows, the command line is a single string, and it is up to the program to interpret what it means, including things like quote characters and globs. If the program is a normal C program, the C runtime interprets command line, and expands the globs, and passes an array of strings to
main
. This is because the C standard requires this.However Perl is not C. Use the
File::Glob
library to expand the arguments.In unix systems, the shell expands globs and passes the file names to the program.
The Windows shell, on the other hand, passes the values as is, and leaves it up to the program to treat them as globs if so desired.
You can perform the globbing as follows:
The
BEGIN
block isn't generally needed, but it will ensure the globing once and early enough when using-n
(which is implied by-p
).The
-MFile::DosGlob=glob
makesglob
have Windows-like semantics. For example, it causes*.*
to match all files, even if they don't contain.
.Integrated: