Some people say Perl stands for Practical Extraction Reporting Language. ... New Facebook/twitter web app, probably bett
Perl - A DBA and Developers best (forgotten) friend
P ERL - A DBA AND D EVELOPERS BEST ( FORGOTTEN ) FRIEND A BEGINNERS GUIDE TO P ERL
Arjen Visser, Dbvisit Software Limited
INTRODUCTION This white paper is focused on the programming language Perl. Its intent is to reintroduce Perl to the Oracle community, especially the DBAs and Developers that use Oracle ; $cwd = `pwd`;
# The output of running the pwd command in Linux/Unix
Notes: •
In PL/SQL the scalar equivalent would be varchar2, numeric, integer, number etc.
Example of Array @versions = ("7.3","8i","9i","10g","11g"); $versions[0] = "7.3"; $versions[1] = "8i"; @ordered_versions = sort @versions;
Notes: •
In Perl an array starts at position 0.
•
There is an automatic scalar associated with each position in the array, eg: $versions[0]
Example of Hash %summer = ( "dec" => "December", "jan" => "January", "feb" => "February");
STEP 2 Declaring - local variables The variables are local to your functions and do not exist outside of the scope in which they are declared. my $i; my @array_versions; my $i = 2;
Declaring - global variables The variables are global to your program. our $Logfile; our @Datafiles; our %Ora_init;
Increment 6
Session #376
Perl - A DBA and Developers best (forgotten) friend
Increment is done in C style. $i++; # $i = $i + 1; $i--; # $i = $i – 1;