#! perl # File: application.pl use strict; use warnings; my $code = $ARGV[0] // 0; printf "In application: result = '%5d' (decimal) or '%016b' (binary)\n", $code, $code; exit $code; #### #! perl # File: driver.pl use strict; use warnings; my $code = $ARGV[0] // 0; my @app = ('perl', 'application.pl', $code); my $result = system(@app); printf "In driver: result = '%5d' (decimal) or '%016b' (binary)\n", $result, $result; printf " >> 8 = '%5d' (decimal) or '%016b' (binary)\n", ($result >> 8), ($result >> 8); #### perl driver.pl 255 #### In application: result = ' 255' (decimal) or '0000000011111111' (binary) In driver: result = '65280' (decimal) or '1111111100000000' (binary) >> 8 = ' 255' (decimal) or '0000000011111111' (binary) #### my $result = system(@app);