Golang Tutorial
Learn Golang tutorials with examples

January 9, 2023 · 2 min read
This tutorial explains how to pass command line arguments to a Perl script file with code examples. Many ways to iterate hash objects in Perl. using a while loop with each hash variable in a conditional expression, returns the next pair of items in a hash, and Iterates each pair of elements, printingkey and value pairs. using for each loop with each hash variable To iterate only keys, use keys with a hash variable, that returns an array of keys, iterate using for loop To iterate only values, use values with hash variable, that returns an array of values, iterate using for loop How to iterate keys and values in Perl Hash using while loop each hashvarible returns the next key and value of elements of the hash object....
January 9, 2023 · 1 min read
This tutorial explains about how to get Current Date and time in Local and UTC How to get Current Date and time in UTC format in Perl using DateTime use strict; use warnings; use DateTime; my $dt = DateTime->now; print "$dt" How to get Current Date and time in Local System time in Perl This is an example of getting date and time of a Local System. use strict; use warnings; use DateTime; my $dt = Localtime(); print "$dt" ...
January 9, 2023 · 2 min read
Multiple ways to get Unix timestamp in Perl using Perl’s Inbuilt time function, which returns a long number.time() outputs the long number time function in cpan Time::HiRes module. What is the Current Epoch(Unix) time in Perl Epoch time is the total number of seconds, the ie long number represents that already passed from 1 January 1970 UTC. the total number of seconds per day is 24\* 60\*60 seconds. Epoch time returns the long number between the current time and 1 January 1970....
January 9, 2023 · 2 min read
This tutorial explains Multiple ways to check whether a given string is empty or not with Perl code examples. using string comparison operator, eq and ne, $str eq "" or numeric comparison operator $str=="" Another way using length function. length($str) == 0 Perl String Check Empty using string comparison operators Perl provides the following String numeric operators. eq is an equal operator, Check given string is matched for another string....
January 9, 2023 · 2 min read
Multiple ways to call a shell script or a command from Perl code. Using System function with command and arguments, example system(“sh test.sh”,), control returned to called code with output and errors. using the exec function, It breaks the execution once the command executes. How to call shell commands or scripts from Perl with code examples using the System function The System function executes the command or scripts and returns the control to the next line of execution Syntax:...
Recent posts
Julia examples - Variable Type Nim example - Convert String to/from the Int How to get length of an array and sequence in Nim? Nim environment variables - read, set, delete, exists, and iterate examples? How to convert from single character to/from string in Nim?