Besides wrog's suggestion to enclose them in double quotes, you can export them, then they will be accessible in Perl via %ENV
#!/usr/bin/bash # do other processing # export the desired variables export OPC_MSG_TEXT OPC_MSG_CODE # use Perl for further processing ovo-test.pl
#!/usr/bin/perl use strict; use warnings; my $text = $ENV{OPC_MSG_TEXT}; my $code = $ENV{OPC_MSG_CODE}; ...;
|
|---|