Search notes:

Perl function: system

use warnings;
use strict;

my $arg = $ARGV[0];

if (defined $arg and $arg eq 'exit_with_value') {
  exit 42;
}

my $exit_value = system('system.pl exit_with_value');
# The exit value is a 16 bit value:
#   the low 7 bits are the signal the process died from
#     (if any) and
#   the high 8 bits are the actuel exit value
#
# In order to get the output of a command, use backticks ``
#
# See also IPC::Run

printf "exit value: %d\n", $exit_value >> 8;
Github repository about-perl, path: /functions/system.pl

See also

Perl functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199967, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/functions/system(63): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78