Category Archives: perl

How To Prevent A PERL Script From Running As Root

At or near the top of your app, before it executes anything sensitive, place the following code: if((getpwuid($

Posted in How Tos, perl, Programming | 1 Comment

PERL How To Print A List Without A Loop

PERL has a built-in function called join() that will concatenate a list with a given string. The official perldoc states: join EXPR,LIST Joins the separate strings of LIST into a single string with fields separated by the value of EXPR, … Continue reading

Posted in How Tos, perl, Programming, Software | Leave a comment

perl howto push a hash onto an array

This could also be called how to make an arrays of hashes. The basic idea is to create a list of items that when iterated, returns individual hashes. use Data::Dumper; my @array; push @array, {‘key1’ => ‘value1’, ‘key2’ => ‘value2’}; … Continue reading

Posted in How Tos, perl, Programming | 2 Comments