in reply to Re^3: Why is IPC::Open2 behaving differently in a .pm? (wrong)
in thread Why is IPC::Open2 behaving differently in a .pm?

Yes, you're quite right. The problem was my json contained single quotes. If I removed them it works the same in both.
  • Comment on Re^4: Why is IPC::Open2 behaving differently in a .pm? (wrong)