in reply to Need help in Text::Table
Basically your data contains extra newlines, if you employ the Basic debugging checklist, perhaps like this
use Data::Dump qw/ dd /; dd [ $hash{"Name"},$hash{"Age"},$hash{"Dept"} ];
You should be able to see where the extra newlines are. Here is an example
More importantly, you should read perlvar#$' and stop using $';
Review perlintro and perlrequick and start using http://perldoc.perl.org/perlintro.html#Parentheses-for-capturing
$Employee{Name} = $1 if /^The employee name is : (\S+)$/mgsi; $Employee{Age} = $1 if /^Age: (\d+) years$/mgsi; $Employee{Department} = $1 if /^Department: (.+?)\s*$/mgsi; if( /^\s*$/ ){ $tb->load ...; undef %Employee; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help in Text::Table
by Anonymous Monk on Jun 14, 2012 at 10:47 UTC | |
|
Re^2: Need help in Text::Table
by ckj (Chaplain) on Jun 14, 2012 at 09:18 UTC | |
by Anonymous Monk on Jun 14, 2012 at 09:41 UTC | |
by Anonymous Monk on Jun 14, 2012 at 10:28 UTC | |
by Anonymous Monk on Jun 14, 2012 at 11:53 UTC |