Wednesday, 5 November 2014

Intimating crontab changes

#!/bin/bash
crontab -l > cronlist
if ! diff cronlistold cronlist > diffs
    then

    cat diffs | grep '<' > removed && remove=`wc -l removed | sed 's/removed//g'` && [ ! "$remove" ] && remove=0
    if [ $remove > 1 ]
    then
     echo "The following lines are removed from old entry" > total
     cat removed | sed 's/<//g' | grep -v tmp >> total
     echo >> total
    fi
   
    cat diffs | grep '>' > added && add=`wc -l added | sed 's/added//g'` && [ ! "$add" ] && add=0
    if [ $add > 1 ]
    then
    echo "The following lines are added newly to crontab" >> total
    cat added | sed 's/>//g' | grep -v tmp >> total
    fi

fi

cat total 2> /dev/null

tot="`cat total  2> /dev/null | wc -l `" && [ ! "$tot" ] && tot=0

if [ $tot -gt   0 ]
    then
    cat total 2> /dev/null
    cat total | mail -s "Crontab changes" praveensam.s@lhsgroup.com
fi
mv cronlist cronlistold && rm -rf total

Tuesday, 12 August 2014

html + tag change + perl

Original:

<td class="build_module">UDRLIB</td><td class="build_file">libudrutil.so</td><td class="build_passed"><a href="http://lund.lhs-systems.com/~develop/nb/archive/I_BSCSIX_R2_AMN03/140620_0100/batch/2/out/log/john.log" target="_blank
<td class="build_module">XBSCS</td><td class="build_file">xbscs</td><td class="build_passed"><a href="http://lund.lhs-systems.com/~develop/nb/archive/I_BSCSIX_R2_AMN03/140620_0100/batch/2/out/log/sam.log" target="_blank

After Changes:

<td class="build_module">UDRLIB</td><td class="build_file">libudrutil.so</td><td class="build_passed"><a href="http://lund.lhs-systems.com/~develop/nb/archive/I_BSCSIX_R2_AMN03/140620_0100/batch/2/out/lib/hpux11_ia64.x/libudrutil.so" target="_blank

<td class="build_module">XBSCS</td><td class="build_file">xbscs</td><td class="build_passed"><a href="http://lund.lhs-systems.com/~develop/nb/archive/I_BSCSIX_R2_AMN03/140620_0100/batch/2/out/bin/hpux11_ia64.x/xbscs" target="_blank

--------------------------------------------------------------------------------------------------------------------------------------

Script:

open("DELIVER","deliver");
open("FILE","samnow");
@list=<DELIVER>;
@line=<FILE>;
my $machine=machine_name();
print "machine:<$machine>\n";
    for($i=0;$i<@line;$i++)
        {
        if(($line[$i]=~/\/batch\//)&&($line[$i]=~/class\=\"build_module\"/))
            {  
            if($line[$i]=~/(class="build_file")(\>)([a-z,A-Z,0-9,_,-,+]+.so)(\<\/td)/)
                {
                chomp($3);
                    &check($3,lib,$machine);  
                }
   
            elsif($line[$i]=~/(class="build_file")(\>)([a-z,A-Z,0-9,_,-,+]+.a)(\<\/td)/)
                {
                chomp($3);
                &check($3,lib,$machine);
                }
            elsif($line[$i]=~/(class="build_file")(\>)([a-z,A-Z,0-9,_,-,+]+)(\<\/td)/)
                {
                chomp($3);
                &check($3,bin,$machine);
                }
            }
        }

sub machine_name
    {
    for($i=0;$i<@line;$i++)
        {
        if(($line[$i]=~/batch/)&&($line[$i]=~/bin/))
            {
            if($line[$i]=~/(\/bin\/)([a-z,A-Z,0-9,_,-,\.,+]+\.x)/)
                {
                chomp($2);
                return $2;  
                last;
                }
            }
        }
    }


 sub check
     {
     $machine=$_[2];
     $deliv=$_[1];
      chomp($checking=$_[0]);
      foreach (@list)
         {
         chomp($_);
         if("$checking" eq "$_" )
             {
            find_replace($checking,$deliv,$machine);
             }
         }
      
     }  

sub find_replace
    {
    $checking_final=$_[0];
    $deliv_final=$_[1];
    $machine_nam=$_[2];
    if ($line[$i] =~ /\/log\//)
    {
    if($line[$i]=~/(\/out\/log\/)([a-z,A-Z,0-9,_,-,+]+.log)/)
        {
        $line[$i]=~s/\/$2//g;

            if ($deliv_final eq "lib")
                {
                $line[$i]=~s/\/log/\/lib\/$machine_nam\/$checking_final/g;
                }
            elsif ($deliv_final eq "bin")
                {
                $line[$i]=~s/\/log/\/bin\/$machine_nam\/$checking_final/g;
                }
            print $line[$i]."\n";
            }
        }
    }


_____________________________________________________________________________________________




Tuesday, 10 June 2014

Perl + Pattern + extraction + stripping

Grepping particular pattern from a log file

1) Extracting contents between the block P1 and P2

2) Filtering particular pattern from the extraction

Example:

P1
10,9:11/18013013582
,10:1
17,9:10/8013765028333384
17,9:10/801376502333884
17,9:10/801dd376502333884

,10:1
,11:1
,12:0
,167:0
289,525:0
308,578:0

P2
x=1
1,64:1
,70:H
P1
,580:2
17,9:10/80137650233
13,9:13/47202177053E0
,10:51
,487:5/G_CGI
26,27:0
,29:S
,31:0

P2

Need to Extract the values after the / --> content high lighted in blue, the script should also ignore the content between P2 and P1


Script

#!/usr/bin/perl

if(! defined($ARGV[0]))
    {
    print "USAGE: perl $0 'filename'\n";
    exit;
    }
open(FILE,"$ARGV[0]");
$je=0;
while($line=<FILE>)
    {
    if($line=~/P1/)
        {
        $x=1;
        }

    if(($x==1)&&($line=~/10,9|17,9/)||($line=~/P1|P2/))
        {
        @spl=split(/\//,$line);
        push(@coll,$spl[1]);
        }

    if($line=~/P2/)
        {
        $x=0;
        $y=start;
        }

    if($y eq "start")
        {
        print "####################################### BLOCK $je #################################################\n";
        foreach (@coll)
            {
            if(defined($_))
                {
                chomp;
                push(@coll1,$_);
                }
            }

        for($i=0;$i<@coll1;$i++)
        {
        if($i%2==0)
            {
            $j=$i+1;
            $coll1[$j]="null" if (!defined($coll1[$j]));
            print $coll1[$i]."  ".$coll1[$j]."\n";
            }
        }
   
        print "##########################################################################################\n";
       
        $y="stop";
        @coll=' ';
        @coll1=' ';
                 $je=$je+1;       
        }
    }
close(FILE);

--------------------------------------------------------------------------------------------------------------------------------------

Results:

perl phaniperl sam
####################################### BLOCK 0 #################################################
18013013582  8013765028333384
801376502333884  801dd376502333884
##########################################################################################
####################################### BLOCK 1 #################################################
   
13233361170  28818773
##########################################################################################
####################################### BLOCK 2 #################################################
   
19079572509  6714829388
##########################################################################################
####################################### BLOCK 3 #################################################
   
19079572509  6714829388
##########################################################################################
####################################### BLOCK 4 #################################################
   
19079572509  4255912230
##########################################################################################





Wednesday, 21 May 2014

Pattern Extraction + perl

Extracting last row from certain pattern in a file , that should be arranged , four in a row

19052014_1559 Java_Version Sun Microsystems Inc. 1.4.2_11
19052014_1559 HeapSizeMax 1580793856
19052014_1559 HeapFreeCurrent 1367237048
19052014_1559 HeapSizeCurrent 1580793856
19052014_1559 HeapFreePercent 86.0
19052014_1607 Java_Version Sun Microsystems Inc. 1.4.2_11
19052014_1607 HeapSizeMax 1580793856
19052014_1607 HeapFreeCurrent 1357926040
19052014_1607 HeapSizeCurrent 1580793856
19052014_1607 HeapFreePercent 85.0
19052014_1615 Java_Version Sun Microsystems Inc. 1.4.2_11
19052014_1615 HeapSizeMax 1580793856
19052014_1615 HeapFreeCurrent 1352909344
19052014_1615 HeapSizeCurrent 1580793856

---------------------------------------------------------------------------------------------------------------------------------------

Output:

1580793856, 1367237048, 1580793856, 86.0

----------------------
1580793856, 1357926040, 1580793856, 85.0

----------------------
1580793856, 1352909344, 1580793856, 85.0
 


--------------------------------------------------------------------------------------------------------------------------------------

open("FILE","kishtry");
$y=0;
while($line=<FILE>)
{
     if($line =~ /Java_Version/)
         {
         $x=0;
        }
    else
        {
         $x=1;
        }

    @s=split(/ /,$line);

    if ($x == 1)
    {
        if($y < 3 )
        {
        chomp($s[@s-1]);
        print "$s[@s-1], ";
        $y=$y+1;
        }
        else
        {
        print "$s[@s-1]\n";
        $y=0;
                print "----------------------\n";
        }
    }
}

    close(FILE);
                
---------------------------------------------------------------------------------------------------------------------------------------




Friday, 16 May 2014

Extracting pattern + from results + perl

Extract Pattern:

MPDE2
./lost+found/sun10_x86.x.70824b20ac1c11de94390002c45ed04c@@/main/0
MPDE2
./bscs/batch/config/README.mpde2@@/main/1
./bscs/batch/config/install.sh@@/main/1
./bscs/batch/config/make.aix4@@/main/1
BATCH
./bscs/batch/bscs.passwd@@/main/1
./bscs/batch/install.txt@@/main/1
./bscs/batch/readme@@/main/1
BATCH
./bscs/batch/build.xml@@/main/1
./bscs/batch/src/bchs/ChargeItem.cpp@@/main/10
./bscs/batch/src/bchs/ChargeItem.hpp@@/main/4
./bscs/batch/src/bchs/DocHeader.cpp@@/main/15
./bscs/batch/src/bchs/DocHeader.hpp@@/main/3
./bscs/batch/src/bchs/UdrLocalDefines.hpp@@/main/2
./bscs/batch/src/bghs/UdrParser.cpp@@/main/10
./bscs/batch/src/bghs/UdrParser.hpp@@/main/7
BATCH
./blueprint/performance/perfclient/input/activateContract.xml@@/main/1
./blueprint/performance/perfclient/input/activateCustomer.xml@@/main/1
./blueprint/performance/perfclient/input/activatePrepaid.xml@@/main/1
./blueprint/performance/perfclient/input/billcycles.txt@@/main/1



Script:


use warnings;
$comp=uc($ARGV[0]);

open("FILE","output2.txt");
@line=<FILE>;
$d=0;
$e=0;
for($i=0;$i<@line;$i++)
{
        chomp($line[$i]);
        if($line[$i]=~/^$comp/)
        {
        $d=$d+1;
        $e=1;
        }
        if($d == 1)
        {
        print $line[$i]."\n";
        }
        $d=0 if($d > 1);
        exit if(($e == 1)&&($line[$i] !~ /^$comp/)&&($line[$i] =~ /^[A-Z]+/));
}







Saturday, 19 April 2014

perl + object oriented + word grep

##############  Package #############################

use warnings;

package file22;    -> Package creation

sub new                -> Constructor creation
    {
    $class=shift;
    $self={
        filename=>shift,
        word=>shift,
        };
    return bless $self, $class; -> Returning self
    }


sub files   
    {
        $self=shift;
    $filenames=$self->{filename};
        open("FILE","$filenames");
    @sam=<FILE>;
    return @sam;
    }

sub grep
    {
    $self=shift;
    @loop=shift;
    $words=$self->{word};
        foreach $i (@loop)
        {
            if ( $i =~ /$words/ )
            {
            push (@gather,$i);
            }
        }
    return @gather;
    }
1;


############# Perl script ###########################

use warnings;

use file22;

$s=file22->new('/etc/passwd',"bin");
@w=$s->files();
@all=$s->grep("@w");
print $_."\n" foreach (@all);

#####################################################









Tuesday, 1 April 2014

Perl + constructor + object

Perl modules:


#!/usr/bin/perl

package file15;      ---> Object Declaration

sub new                 ----> Constructor creation
{
$class=shift; 
$self={
a=>shift,
b=>shift,
};
return bless $self, $class;  --> Blessing self and class
}

sub add                        --> add function
{
$self=shift;                 
$c=shift;
$d=$self->{a} + $self->{b} + $c;
return $d;
}

1;

### perl script


use file15;

$s=file15->new(1,2);    --> Passing values to constructor & creating objects
$d=$s->add(3,4);          ---> Passing values to function
print $d;
~                                                                
~         


#####Results


6







Monday, 10 March 2014

Creating a object in perl

####################Perl Modules #################################

#!/usr/bin/perl

package file8;                  -----> declaring class

sub new                            -----> Variable initiation
{
$class=shift;
$self={
filename=>shift,
word=>shift,
};
return bless $self, $class;
}

sub readi                        ----->  function
{
$line=shift;
if ( $line =~ /$self->{word}/ )
{
return $line;
}
}

sub filer
{
open(FILE,"$self->{filename}");
@s=<FILE>;
return @s;
}

1;
###############Perl Files#####################


#!/usr/bin/perl

use file8;

$s=file8->new("/etc/passwd","bash");    ---------------> creating object
@d=file8::filer;                                             -----> Calling filer function from file8 module
foreach (@d)
{
$s=file8::readi($_);                                      ----> Passing argument directly to function
print $s if ($s);
}


#####################Result ##################

root:x:0:0:root:/root:/bin/bash
git:x:1000:1001:sam,111,211,233,nothing:/home/git:/bin/bash
jenkins:x:119:128::/var/lib/jenkins:/bin/bash
couchdb:x:125:136:CouchDB Administrator,,,:/var/lib/couchdb:/bin/bash


#################Snap############################



Tuesday, 4 March 2014

Accessing a function from perl module

package john;

sub john_home
{
chomp;
$i=shift;
if ( $i eq "y" || $i eq "Y" )
{
$j="working";
return $j;
}
}

1;

########################################################




use john;


$d=john::john_home("y");


print "$d\n";'


########Result##################


working




Wednesday, 19 February 2014

Executing command on remote machine

use Net::SSH::Perl;
  open("FILE","server_list");
   while($line=<FILE>)
{
    chomp $line;
    $host="$line.systems.com";
    my $ssh = Net::SSH::Perl->new($host);
    $ssh->login(username, password);
    my($stdout, $stderr, $exit) = $ssh->cmd('uname -a');
    print $stdout."\n";
}


Monday, 17 February 2014

Thursday, 13 February 2014

Grepping a word using sed (BASH)

cat /etc/passwd

kernoops:x:109:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
pulse:x:110:119:PulseAudio daemon,,,:/var/run/pulse:/bin/false
rtkit:x:111:122:RealtimeKit,,,:/proc:/bin/false
saned:x:112:123::/home/saned:/bin/false
speech-dispatcher:x:113:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
hplip:x:114:7:HPLIP system user,,,:/var/run/hplip:/bin/false
ntp:x:115:124::/home/ntp:/bin/false
puppet:x:116:125:Puppet configuration management daemon,,,:/var/lib/puppet:/bin/false
clamav:x:117:126::/var/lib/clamav:/bin/false
sshd:x:118:65534::/var/run/sshd:/usr/sbin/nologin
git:x:1000:1001:sam,111,211,233,nothing:/home/git:/bin/bash
jenkins:x:119:128::/var/lib/jenkins:/bin/bash
postfix:x:120:130::/var/spool/postfix:/bin/false


 

cat /etc/passwd | sed -n 's/.*\([a-z]\{13\}\)[[:space:]]\([a-z]*\)[[:space:]]\([a-z]*\).*/\1 \3/p'

configuration daemon


\([a-z]\{13\}\)      Configuration --> \1  first matched group pattern

 ([a-z]*\)               daemon --> \2 second matched group pattern

Tuesday, 11 February 2014

Grepping only Feb , 11 th log from auth.log using perl

open("FILE","/var/log/auth.log");
while($line=<FILE>)
{
if($line=~m/(\b[A-Z,a-z]{3}\b)(\s+)(\d+)/)
{
if(($1 eq "Feb" )&&($3==11))
{
print "$line"."\n";
}
}
}

Wednesday, 5 February 2014

Finding uniq and repeated words in perl

%hash=();
open("FILE","/etc/passwd");
while($line=<FILE>)
{
chomp($line);
push (@s,$_) foreach (split(":",$line));
}
foreach (@s)
{
$hash{$_}++;
}
print "Word no of occurance";
foreach $key (keys %hash)
{
print $key."=".$hash{$key}."\n";
}
%hashn=();
foreach (@s)
{
unless(exists $hashn{$_} )
{
$hashn{$_}++;
}
else
{
push (@uniq,$_);
}
}
%hashne=();
foreach (@uniq)
{
$hashne{$_}=0;
}
print "Repeating word\n";
foreach $kys (keys %hashne)
{
print "$kys   ";
}

print "\n";

Inserting a line in middle of a file , select,

open(READ,"$ARGV[0]");
open(WRITE,">>sam");
select WRITE;
@s=<READ>;
$last=@s;
for($i=0;$i<@s;$i++)
{
if ($s[$i] =~ m/$ARGV[1]/i )
{
print $s[$i];
$lineno=$i;
}
}
###(pattern)
sub fore
{
for($i=$_[0];$i<$_[1];$i++)
{
print $s[$i]."\n";
}
}
##Insert line

&fore(0,$lineno);
print "$ARGV[2]"."\n";
&fore($lineno,$last);
select STDOUT;
print "Work Successfully finished , Please check the file name 'sam'.\n";

"usage :

perl scriptname "filename where you need to search" "pattern to search" "line to append"

example:
perl script_name  "/etc/passwd"  "drizzle" "hi this is sam"

output will be redirect to a filename "sam"



"git:x:1000:1001:sam,111,211,
233,nothing:/home/git:/bin/bash

jenkins:x:119:128::/var/lib/jenkins:/bin/bash

postfix:x:120:130::/var/spool/postfix:/bin/false

hi this is sam
drizzle:x:121:132:Drizzle Server,,,:/var/lib/drizzle:/bin/false

ebnetd:x:122:65534:ebnetd,,,:/var/lib/ebnetd:/bin/false

memcache:x:123:133:Memcached,,,:/nonexistent:/bin/false"
 
 

Thursday, 16 January 2014

Perl grep ( grepping a line before the pattern match)

($inp=$ARGV[0]) || chomp($inp=<STDIN>);
open("FILE","/etc/passwd");
@s=<FILE>;
foreach $line (@s)
{
$x++;
if( $line=~/$inp/)
{
$d=$x;
}
}
$d=$d-2;
foreach $line (@s)
{
$y++;
if($y==$d)
{
print $line."\n";
}
}

Perl LABEL

DESK:
{
print "bye";
}



print "hit";
goto DESK;


Monday, 13 January 2014

Perl string concatenation

open("FILE","/etc/passwd");
while($line=<FILE>)
{
@s=split(":",$line);
$k.=" # $s[0]";
print $k."\n";
}

Usage:
# root # daemon # bin # sys # sync # games # man # lp # mail # news # uucp # proxy # www-data # backup # list # irc # gnats # nobody # libuuid # syslog # messagebus # colord # lightdm # whoopsie # avahi-autoipd # avahi # usbmux # kernoops # pulse # rtkit # saned # speech-dispatcher #

Saturday, 11 January 2014

Map function in perl

@s=qw( sam bam cam jam );
map { $_ = "$_.so" } (@s);
foreach $i (@s)
{
print $i."\n";
}

Thursday, 9 January 2014

Perl format converter ( symbol and character )

Format:

bin/$OSDIR/(foh) lib/$OSDIR/(libdx_t libmpxref_t libudr_t libudrInt_t libshmadm libudr libudrInt libdx libdta libnatax libmprdm libmputil libmpanonym libmpxref libmpcontainer libnumnorm libmpbasics libtax libbat++ libbat++curcy libbat libcomlock libhooks libudr_sh librulelib libudr_sh_t)

Converted Format:

bin/$OSDIR/foh.so lib/$OSDIR/{libdx_t.so,libmpxref_t.so,libudr_t.so,libudrInt_t.so,libshmadm.so
,libudr.so,libudrInt.so,libdx.so,libdta.so,libnatax.so,libmprdm.so
,libmputil.so,libmpanonym.so,libmpxref.so,libmpcontainer.so,libnumnorm.so,
libmpbasics.so,libtax.so,libbat++.so,libbat++curcy.so,libbat.so,
libcomlock.so,libhooks.so,libudr_sh.so,librulelib.so,libudr_sh_t.so}


Script:

open("FILE","<libsa");
open("FILE1",">>libsa1");

print FILE1 "{";
while($line=<FILE>)
{
$line=~tr/()/{}/;
@s=split(" ",$line);
foreach $i (@s)
{
if ( $i =~ /lib[a-z,A-Z,_]*/ && $i =~ /{lib/ )
 {
    print FILE1 "$i.so,";
 }
elsif ( $i =~ /[a-z,A-z]*/ && $i =~ /{/ && $i =~ /}/ )
 {
    $i=~s/{//;
    $i=~s/}//;
    print FILE1 "$i,";
 }
elsif ( $i =~ /lib[a-z,A-Z,_,.]/ )
 {
    if ( $i =~ /}/ )
    {
    $i=~s/}//;
    print FILE1 "$i.so,"."}";
    }
    else
    {
    print FILE1 "$i.so,";
    }
 }
else
 {
     print FILE1 "$i,";
 }
}

}
print FILE1 "/dev/null}\n";



Same Script in Shell:

cat inputfile | grep -i "(lib[a-x]"  | tr '()' '{}' |  sed -e  's/lib[a-z,A-Z,+,_]*/&.so /g'  -e 's/\s\+/,/g' -e 's/\,\}/}/g' -e 's/\}\,/} /g' -e 's/lib.so,/lib/g' | tr ' ' '\n' | awk 'BEGIN{FS=" "} {if(($0~/{[a-z]*.*}/)&&($0!~/,/)) {gsub(/[{,}]/,"");print} else {print}}'



Wednesday, 8 January 2014

Extracting particular content from xml using perl script

open("FILE","test1.xml");
while($line=<FILE>)
{
@s=split(" ",$line);
foreach $i (@s)
{
if($i=~/\bCT=|\bSN=|\bChType=|\bNI=|\bOAmt=|\bDAmt=/)
{
print $i.";";
}
}
print "\n";
}

Monday, 6 January 2014

Creating path variable in linux

#!/ bin/bash
for i in *
do
[ -d "$i" ] && TEST=$TEST:$i
done
TEST=${TEST#:}
export TEST
echo TEST=$TEST

Sunday, 5 January 2014

Windows Batch script for setting up environment

@echo off
echo > %TEMP%\tpplist.txt
echo > %TEMP%\tppfinal.txt
cls
set dash=#################################################################### 
echo %dash%
echo.
echo Select the 3pp from the below list
echo %dash%
echo.

type  C:\Users\spraveen\Documents\file_list_new.txt
echo.
echo %dash%
echo.

echo Enter the 3pp name
echo.
set /p as=
echo.
echo %dash%
echo.
echo Please select the version that you want to set from the below list  Please type the full name as like in the list or copy paste
echo.
echo %dash%
echo.
type C:\Users\spraveen\Documents\log.txt | findstr /i %as%

if %errorlevel% neq 0 (
echo The 3pp that you have entered is not in the list \n
goto ERROR
)

type C:\Users\spraveen\Documents\applications.txt | findstr /i %as% >> %TEMP%\tpplist.txt

echo.
echo %dash%
echo.
echo Please enter the version name
echo.
echo %dash%
echo.
set /p threever=
echo.
type %TEMP%\tpplist.txt | findstr /i %threever%

if %errorlevel% neq 0 (
echo The version you have entered is not in the list please re-enter properly
goto ERROR
)
echo.
echo %dash%
echo.
echo You have chosen the following version
echo.
echo %dash%
type %TEMP%\tpplist.txt | findstr /i %threever% >> %TEMP%\tppfinal.txt

for /f "tokens=1* delims==" %%u in (%TEMP%\tppfinal.txt) do (
echo %%u
)
echo.
echo %dash%
echo.

echo Confirm to set the version [y/n]
set /p inp=
set trig=false
if "%inp%" == "y" set trig=true
if "%inp%" == "Y" set trig=true
if "%trig%" == "true" (
echo hi
) else (
goto ERROR
)

for /f "tokens=2* delims==" %%v in (%TEMP%\tppfinal.txt) do (
echo %%v
)




:ERROR

Perl password crypt

#!/usr/bin/perl
chomp($line=<STDIN>);
$s=crypt($line,salt);
if ( $s eq 'saUc1YKRDDT5E' )
{
print "You have cracked the code Boss :) \n";
 }



Usage:

perl filename sam

Friday, 3 January 2014