in reply to Loading an anonymous hash
$Employee_Rec = [ {Emp_No=>1, Emp_Lname=>2, Emp_Fname=>3, Emp_SSN=>4, Emp_DOB=>5, Emp_aka=>6} ];
That's an anonymous array with a single element, an anonynmous hash where the values are sequential integers. What were you trying to accomplish by creating this structure? Are you by any chance trying to use the deprecated psuedo-hash system?
Later in the code it looks like you're treating $Employee_Rec as a simple hash-ref, which makes more sense. If that's what you want you don't need to do any pre-initialization and the "magic code" you're looking for is probably something like:
my @data = split(',',$_); $Employee_Rec->{Emp_No} = $data[0]; $Employee_Rec->{Emp_Lname} = $data[1]; ...
That will only work for very simple CSV files though - if you're dealing with something more complicated take a look at Text::CSV_XS.
-sam
|
|---|