Hi, I already have 2-3 perls in my windows system. EC perl libraries is one of them. I want to try the code below:
use strict; use warnings; use Time::Piece; my $str1 = 'Execution started at 05/25/2011 05:22:03 PM'; my $str2 = 'Execution completed at 05/25/2011 05:34:08 PM'; my @times = map Time::Piece->strptime(/(\d.+M)/, '%m/%d/%Y %H:%M:%S %p'), $str1, $str2; my $delta = $times[1] - $times[0]; print $delta->pretty;
But, there is an error:
Can't locate Time/Piece.pm in @INC (@INC contains: C:\Program Files\Electric Cloud\ElectricCommander\perl\site\lib C:/Program Files/Electric Cloud/ElectricCommander/perl/lib C:/Program Files/Electric Cloud/ElectricCommander/perl/site/lib .) at C:\Pearls\Temp.pl line 4. BEGIN failed--compilation aborted at C:\Pearls\Temp.pl line 4.
I did windows cmd -> cd C:\Program Files\Electric Cloud\ElectricCommander\perl\site\lib -> cpan -> install Time::Piece.
It installed into the other perl directory and not ec perl. How do I make it install in the EC perl ? Thanks !
Answer by tanay · Nov 30, 2014 at 01:58 PM
Sounds like an environment varialble issue -- perhaps PERL5LIB is set to the non-ec-perl directory?
BTW, this link may be helpful: https://electriccloud.zendesk.com/hc/en-us/articles/202828073-KBEC-00180-Installing-Perl-modules-into-the-Commander-Perl-distribution
Answer by mike westerhof · Sep 06, 2015 at 02:51 AM
See the lengthy answer to the following ASK question:
https://ask.electric-cloud.com/questions/6176/how-to-add-cpan-modules-to-ec-perl.html
A quick look at the contents of the downloaded Time-Piece perl module from CPAN shows that is in fact one of the "non-pure-perl" modules -- it contains C language code that must be compiled for your machine in order to be used. As the answer to the other ASK question notes, on a Windows platform especially that makes it nearly impossible to add this module to ec-perl.
I'd urge you to consider one of the other approaches instead.
What is the correct syntax for accessing object attributes in EC-Perl scripts? 1 Answer
Need to get right ordering of jobs in ec-perl 2 Answers
Need a little help in small ec-perl code 2 Answers
Do agent machines use the server's LD_LIBRARY_PATH value? 1 Answer
how to select and delete multiple procedures from a project 1 Answer
Electric Cloud powers Continuous Delivery, helping organizations developing deliver better software faster by automating and accelerating build, test, and deployment processes at scale. Industry leaders like Qualcomm, SpaceX, Cisco, GE, Gap, and E*TRADE use Electric Cloud solutions to boost DevOps productivity and Agile throughput.