Thank you all for your help, I got the desired result and didn't have to change the contents of the file, here is the code for reference

use Path::Class; use Data::Dumper; #Input was inserted into a file... my $dir = dir("C:\\temp\\"); my $file = $dir->file("hashinput.txt"); my $file_handle = $file->openr(); my %slotHash = (); while (my $line = $file_handle->getline()){ if (index($line, "Press", 0) == -1 && index($line, "Slot", 0) +== -1) { $value0 = substr($line, 0, 2); $value1 = substr($line, 3, 17); $value2 = substr($line, 20, 15); $value3 = substr($line, 36, 17); $value4 = substr($line, 55, 17); $uptime = $value4; my $find = " days "; my $replace = ":"; $find = quotemeta $find; # escape regex metachars if prese +nt $uptime =~ s/$find/$replace/g; $delimiter = quotemeta(":"); my @uptime = split(/$delimiter/, $uptime); $totalUptime = (((@uptime[0] * 24) * 60) * 60) + ((@uptime +[1] * 60) * 60) + (@uptime[2] * 60) + @uptime[3]; $slothash{$value0} = ( {type => substr($value1,0, 3) ,slotID => $value0, des +cription => $value1,hwVersion => $value2, swVersion => $value3 ,slotI +d => $value0, upTime => $totalUptime} ); } } print Dumper(\%slothash);
THANKS!

In reply to Re^4: Defining hash structure by mtx
in thread Defining hash structure by mtx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.