padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks:
I was looking around and found a good script that can
convert a csv to a xls file, this is
something I need to do for one of my projects
so I downloaded the source code and just paste it
and it work fine
so my first question:
can I use the code as it is? or need to talk to the author to see if is ok with him?
Second question :
If it is ok to run it and change it a bit, how can I make this script work with more than one file? for example I have a list of file that need to convert from csv to xls, and going one by one is not acceptable, can someone help me in these issue?
and last one
if I can not modify the script but I can use it is there a way I can run a that script from another script?
thanks for your help

Replies are listed 'Best First'.
Re: I have a few questions
by shmem (Chancellor) on Jan 11, 2008 at 00:34 UTC
    can I use the code as it is? or need to talk to the author to see if is ok with him?
    It wouldn't have been published here if there was some legal mumbo jumbo around it. To be sure, just send a private /msg to the author.
    if I can not modify the script but I can use it is there a way I can run a that script from another script?

    You could wrap some shell code around it, or run it from a perl process via do. Be sure to set up its arguments properly, assigning to @ARGV or some such.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      Hi !!!
      For example in these script csv2xls1.pl
      when I need to convert a csv to xls i need to do these
      csv2xls1.pl infile.csv outfile

      but I can leave blank the outfile and it will use the same file name
      can you show me how to use do
      for these script?
      thanks

        Not tested

        use strict; my $dir = "C:/some/dir"; my $script = "C:/path/to/csv2xls1.pl"; my @files = glob("$dir/*.csv"); for my $file (@files) { print "Processing $file ....."; my $ret_val = system( $script, $file ); print ret_val == 0 ? "OK\n" : "Not OK\n"; } print "Done!\n";
Re: I have a few questions
by hipowls (Curate) on Jan 11, 2008 at 03:01 UTC

    The author states "That [part of the] code is all cut and past from the Spreadsheet::WriteExcel examples". Since Spreadsheet::WriteExcel is licensed under the Artistic License and the GPL then the script will also be licensed under the GPL if not the Artistic license

    Disclamer: I am not a lawyer, don't go to court on this advise;)

Re: I have a few questions
by gam3 (Curate) on Jan 11, 2008 at 01:09 UTC
    If there is no copyright information in the file, then in the United States the Author has complete control over its copyrights. If there is no copyright info you should ask the author to send you a copy with the Perl Artistic License.

    Under the Artistic License you should be able to do any and all the things you want to do with the source code.

    -- gam3
    A picture is worth a thousand words, but takes 200K.