in reply to Re^2: Perl OLE Excel Sort By Color
in thread Perl OLE Excel Sort By Color

sortByColor("D:/sort.xls",12);

sub sortByColor()
{
    my $filename = $_[0];
    my $no_of_columns = $_[1];
    ...
}

You are still prototyping the  sortByColor subroutine to take no parameters. You are calling the subroutine and passing it two parameters in such a way as to defeat prototype checking. I suppose one might ask why one would use prototypes in such a way, but if you're happy with the code, so am I!

More importantly, you also are apparently running your code without warnings enabled. I think this is a bad idea for one new to Perl coding (and also for the experienced): I strongly recommend that you enable them.


Give a man a fish:  <%-(-(-(-<

Replies are listed 'Best First'.
Re^4: Perl OLE Excel Sort By Color
by martinslmn (Novice) on Jun 04, 2015 at 04:07 UTC
    Hi, I have modified the code.
    sortByColor("D:/sort.xls",12); sub sortByColor { my $filename = $_[0]; my $no_of_columns = $_[1]; ... }
    And I am using the following modules. I did not paste the m here before.
    use strict; use warnings; use POSIX qw(strftime); use Net::Google::Drive::Simple; use WWW::Mechanize; use HTTP::Cookies; use LWP::Debug qw(+); use URL::Encode; use URI::Escape; use Date::Simple qw(date); use File::Copy; use Data::Table::Excel; use Data::Dumper; use Modern::Perl; use Tie::File qw(); use Switch; use Win32::OLE::Const "Microsoft Excel"; use Digest::MD5 qw(md5_hex); use IO::Uncompress::Unzip qw(unzip $UnzipError);
    This script automates a process that usually takes 5 hours of manual work each day. And I was able to reduce it to 15 mins. Thank you all for your help.I completed it.