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


In reply to Re: Win file/dir names w/spaces by kcott
in thread Win file/dir names w/spaces by LloydRice

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.