Why doesn't the backticks operator in Perl work without quotes in Windows?

I'm new to Perl, so forgive me if the question is trivial.

At work, I have the task of creating a script that will send emails when other developers miss the due date for their tasks. Since all of this would have to work on Windows using Strawberry Perl, I used the windows command date /Tto do a date check. I called quite a few external commands using the backticks operator, but in this particular case the reverse steps did not work:

my $date = `date /T`;

Outputs:

date: invalid date `/T'

Fixed the use of some additional quotes:

 my $date = `"date /T"`

Outputs:

Mon 07/07/2014

My question is: why is this?

, backticks , , , .

+4
1

, Cygwin/GnuTools date.

Windows date /T .
, .

date /T Cygwin/GnuTools date: invalid date '/T'.
, 1) Windows date 2) date PATH .

+5

Source: https://habr.com/ru/post/1547492/


All Articles