use IPC::System::Simple qw/capturex/; print capturex($^X, qw/ -wMstrict -MData::Dump -e dd@ARGV -- /, "\r", "\\r"); # => prints ("\r", "\\r")