I just want to convert the dates from 20111230 format to 30-dec-2011.
20111230
30-dec-2011
In keeping with TMTOWTDI, you can use Time::Piece
#!/usr/bin/env perl use strict; use warnings; use Time::Piece; my $t = Time::Piece->strptime("20111230", "%Y%m%d"); print $t->strftime("%d-%b-%Y\n");