in reply to Win file/dir names w/spaces
G'day LloydRice,
You appear to have answers to your questions from various monks.
Seeing the amount of code you wrote for your tests, I thought I'd introduce you to the built-in module Test::More.
I don't have Perl running on an MSWin platform (so I can't duplicate your exact tests) but the following should give you an idea of how much coding this module can save you. I also think that, with the substantially reduced code, the tests themselves become far more obvious and the code is more readable and maintainable.
#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 3; ok(-e '/Users/ken/tmp/Sample Music', 'Single quotes'); ok(-e "/Users/ken/tmp/Sample Music", 'Double quotes'); ok(-e "'/Users/ken/tmp/Sample Music'", 'Single quotes in double quotes +');
Output:
1..3 ok 1 - Single quotes ok 2 - Double quotes not ok 3 - Single quotes in double quotes # Failed test 'Single quotes in double quotes' # at ./pm_example.pl line 10. # Looks like you failed 1 test of 3.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win file/dir names w/spaces
by LloydRice (Beadle) on Mar 26, 2014 at 10:16 UTC |