The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

kvwood (3) [Avatar] Offline
#1
Hello all,

I initially tried running the scripts as printed in Minimal Perl under ActivePerl on Windows, with no success. After much trial and error, I discovered that the quoting needs to be changed from ' ... ' to " ... " after the -e command line switch.

So, this (on Linux):
$ perl -wnl -e '$. >= 458 and $. <= 478 and print "$.: $_";' myfile

becomes this (on Windows):
c:> perl -wnl -e "$. >= 458 and $. <= 478 and print "$.: $_";" myfile

Note how you need to use the " ... " escape sequence with print " ... ", since it is already enclosed in double quotes.

I haven't tried anything on Windows past chapter 4, so I don't know if there are any further changes needed.

It would be great if the book could be updated with an appendix informing Windows users of these conversion issues. I know the book draws parallels with the Unix shell utilities, but these Perl scripts are just as useful on Windows, and perhaps even more useful, since the typical Unix tools are missing.

Message was edited by:
kvwood
tmaher (37) [Avatar] Offline
#2
Re: Modifying scripts for Windows
> Hello all,
>
> I initially tried running the scripts as printed in
> Minimal Perl under ActivePerl on Windows, with no
> success. After much trial and error, I discovered
> that the quoting needs to be changed from ' ... ' to
> " ... " after the -e command line switch.

Glad you figured this out! But you're modifying commands here;
scripts won't need these kinds of modifications.

> It would be great if the book could be updated with
> an appendix informing Windows users of these
> conversion issues. I know the book draws parallels
> with the Unix shell utilities, but these Perl scripts
> are just as useful on Windows, and perhaps even more
> useful, since the typical Unix tools are missing.
>
> Message was edited by:
> kvwood

I'm inclined to agree with you, and I'll look into the possibility of providing some basic
guidelines at MinimalPerl.com to help readers run the book's programs on
Windows.

-Tim