Other monks have provided the answer you were looking for.
A debugging technique I use is to remove as much code as possible to still reproduce the problem. Combining this with
use diagnostics;, it may have been more evident what the real issue was, rather than the misleading "Bareword" error.
#!/usr/bin/env perl
use strict;
use warnings;
use diagnostics;
my $path = 'C:\chas_sandbox\';
print $path;
outputs:
Can't find string terminator "'" anywhere before EOF at ./686348.pl li
+ne 7 (#1)
(F) Perl strings can stretch over multiple lines. This message me
+ans
that the closing delimiter was omitted. Because bracketed quotes
+count
nesting levels, the following is missing its final parenthesis:
print q(The character '(' starts a side comment.);
If you're getting this error from a here-document, you may have in
+cluded
unseen whitespace before or after your closing tag. A good program
+mer's
editor will have a way to help you find these characters.
Uncaught exception from user code:
Can't find string terminator "'" anywhere before EOF at ./6863
+48.pl line 7.
at ./686348.pl line 7
Hope this helps.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.