in reply to Re: Scripts work when run individually but not when run as one compiled script
in thread Scripts work when run individually but not when run as one compiled script

I use this line.. my $xlsx_WSD = ( "C:\\Temp\\Data\\data.xlsx"),, 1; because in windows the file can be read if it is open.
  • Comment on Re^2: Scripts work when run individually but not when run as one compiled script

Replies are listed 'Best First'.
Re^3: Scripts work when run individually but not when run as one compiled script
by shmem (Chancellor) on Jan 20, 2016 at 13:08 UTC
    I use this line.. my $xlsx_WSD = ( "C:\\Temp\\Data\\data.xlsx"),, 1; because in windows the file can be read if it is open.

    Well, the ,, 1 from above is gratuitous:

    qwurx [shmem] ~> perl -MO=Deparse -e '$xlsx_WSD = ( "C:\\Temp\\Data\\d +ata.xlsx"),, 1;' $xlsx_WSD = 'C:\\Temp\\Data\\data.xlsx', '???'; -e syntax OK

    See the '???' ? This is what's optimized away: the commas, and the 1.

    Then, of course the file can be read if it is open - but only if it is opened for reading, right?

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
Re^3: Scripts work when run individually but not when run as one compiled script
by poj (Abbot) on Jan 20, 2016 at 13:20 UTC
    in windows the file can be read if it is open.

    As I said here, that maybe true for Excel using Visual Basic for Applications but not in Perl.

    poj