I opened a new web site “Tajitools” which provides nice-to-have web tools for software development and daily office work. I’m adding new tools little by little.
To get the number of items in an array, you can evaluate the array as scalar context.
my @array = ("Apple", "Orange", "Tomato"); my $count = @array; print $count;
Also scalar method can be used. This way seems more simple.
In order to continue a job after logout, we can use “nohup” command which ignores HUP signal.
$ nohup command
Adding “&” gets the command to run in background.
$ nohup command &
Standard output and error of the command are output to nohup.out file created in the directory where the command is executed. If you want to avoid the file creation, redirect standard error to standard output and standard output to /dev/null.
$ nohup command > /dev/null 2>&1 &
Usually “nohup” is used in this style.