in reply to Using scalar variable in system set of commands

By using the backslash, you prevent $month from being interpolated in the doublequotes. The shell then gets $month and tries to expand it - but there is no shell variable named $month.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Using scalar variable in system set of commands

Replies are listed 'Best First'.
Re^2: Using scalar variable in system set of commands
by tobyink (Canon) on Nov 01, 2012 at 14:50 UTC
    Indeed. The backslashes before the pipes are also unnecessary.
    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'