text::CSV

K

king

I have a script which i converted into executable using PDK.

when i run the executable using i get a error saying
"
C:\Users\hacharyx\Desktop\C_State_Residency>C_State_residency.exe
Can't locate Text/CSV_PP.pm in @INC (@INC contains:) at (eval 12) line
2.
at perlapp line 843
BEGIN failed--compilation aborted at C_State_residency.pl line 5."

But when I run the .pl file it works fine.

The script is as follows.
"
#!/c/perl64/bin

use strict;
use warnings;
use Text::CSV;
use Win32::OLE('in');
######################################################################
sleep 4;

system("typeperf \"\\Processor\(\*\)\\% C1 Time\" -sc 50 -o c1.csv");

sleep 1;
######################################################################
my $file_1 = 'c1.csv';

my $csv_1 = Text::CSV->new();

open (CSV_1, "<", $file_1) or die $!;
my @c1_total;
my @column_1;
my $value_1;
my $i;
my $sum_1=0;

while (<CSV_1>)
{
if ($csv_1->parse($_))
{
my @columns_1 = $csv_1->fields();

#print "@columns_1\n";
push(@c1_total, $columns_1[$#columns_1]);

}
else
{
my $err = $csv_1->error_input;
print "Failed to parse line: $err";
}
}
close CSV_1;

shift(@c1_total);
shift(@c1_total);

foreach $value_1 (@c1_total)
{
print "$value_1\n";
}
for($i=0; $i<= $#c1_total; $i++)
{
$sum_1 = $sum_1 + $c1_total[$i];
}
my $avg_1 = $sum_1/($#c1_total+1);

open(Mini_Bat,">>C:\\Tests\\Logs\\Mini_Bat\\Mini_Bat.txt");
print "C1 Avg: $avg_1\n";
print Mini_Bat "% of avg. C1 Time: $avg_1\n";
######################################################################
"

Can anybody help me why it is not working if run after converting into
a executable?
 
C

C.DeRykus

I have a script which i converted into executable using PDK.

when i run the executable using i get a error saying
"
C:\Users\hacharyx\Desktop\C_State_Residency>C_State_residency.exe
Can't locate Text/CSV_PP.pm in @INC (@INC contains:) at (eval 12) line
2.
 at perlapp line 843
...

Did you first check Activestate's PDK resources -
FAQ, archives, user forums...
 
J

John Mason Jr

I have a script which i converted into executable using PDK.

when i run the executable using i get a error saying
"
C:\Users\hacharyx\Desktop\C_State_Residency>C_State_residency.exe
Can't locate Text/CSV_PP.pm in @INC (@INC contains:) at (eval 12) line
2.
at perlapp line 843
BEGIN failed--compilation aborted at C_State_residency.pl line 5."

But when I run the .pl file it works fine.

The script is as follows.
"
#!/c/perl64/bin

use strict;
use warnings;
use Text::CSV;
use Win32::OLE('in');
######################################################################
sleep 4;

system("typeperf \"\\Processor\(\*\)\\% C1 Time\" -sc 50 -o c1.csv");

sleep 1;
######################################################################
my $file_1 = 'c1.csv';

my $csv_1 = Text::CSV->new();

open (CSV_1, "<", $file_1) or die $!;
my @c1_total;
my @column_1;
my $value_1;
my $i;
my $sum_1=0;

while (<CSV_1>)
{
if ($csv_1->parse($_))
{
my @columns_1 = $csv_1->fields();

#print "@columns_1\n";
push(@c1_total, $columns_1[$#columns_1]);

}
else
{
my $err = $csv_1->error_input;
print "Failed to parse line: $err";
}
}
close CSV_1;

shift(@c1_total);
shift(@c1_total);

foreach $value_1 (@c1_total)
{
print "$value_1\n";
}
for($i=0; $i<= $#c1_total; $i++)
{
$sum_1 = $sum_1 + $c1_total[$i];
}
my $avg_1 = $sum_1/($#c1_total+1);

open(Mini_Bat,">>C:\\Tests\\Logs\\Mini_Bat\\Mini_Bat.txt");
print "C1 Avg: $avg_1\n";
print Mini_Bat "% of avg. C1 Time: $avg_1\n";
######################################################################
"

Can anybody help me why it is not working if run after converting into
a executable?



Just tell perl app to include the module and you will be fine.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top