Below is my package
#!/usr/bin/perl
package PSmart::Results;
use Spreadsheet::WriteExcel;
sub new{
my ($class,$file) = @_;
if(-s $file){
print "$file already exist. Please check\n";
exit;
}else{
my $worksheet = createsheet($file);
bless $worksheet, $class;
return $worksheet;
}
}
sub createsheet {
my $file = shift;
my $workbook = Spreadsheet::WriteExcel->new($file);
my $traffic = $workbook->add_worksheet('traffic');
#$traffic->write(0,0,'Test');
#my $smfdata = $workbook->add_worksheet('smfdata');
#my $sipdump = $workbook->add_worksheet('sipdump');
#my $header = $workbook->add_format();
# $header->set_bold();
# $header->set_size(12);
# $header->set_color('blue');
my $worksheet = {
'traffic' => $traffic,
};
return $worksheet;
}
sub writetrafic {
my ($self,$row,$data) = @_;
$self->{'traffic'}->write(1, 0, "jegadeesh");
}
1;
From my pl script i called write trafic subroutine and try to write data in the sheet. but its not happen. Please guide me.
Thanks,
Jegadeesh
![](https://ci3.googleusercontent.com/proxy/80vRm31fDR7mENMi9cxnEB13NRbUjhE3EsEGKfxCPlNY20H4F-pxFJCO3Qk29AhQ1EaoBpUW_pZp4GAB99FzAXKiPZ9zWc6dwEgRjQvAU3TsTuQjLHJU9_pRtGUmE98WSCpZku5XXWcEeR2fBKl2CRsTtBw=s0-d-e1-ft#http://www4.broadsoft.com/rs/broadsoft/images/connections-2015-email-footer-logo-FINAL-042415.jpg)
This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient and have received this email in error, please notify BroadSoft, Inc. immediately by replying to this message, and destroy all copies of this message, along with any attachment, prior to reading, distributing or copying it.