I don't quite understand the problem.
From the OP: Internally, I use / as a separator whenever possible. For path strings I get from the "outside", I use File::Spec to be OS independent.
Do any paths come from somewhere else, that you can't keep track of and normalize? My point is that Path::Class, just as File::Spec which it uses internally, expects Unix style paths when run on Unix, and Windows style paths when run on Windows, unless you tell it otherwise. So for new never-before-seen paths you do
my $path = dir($from_outside)->as_foreign('Unix');
and once they're internal, you just do
my $path = foreign_dir('Unix', $internal);
Is this unapplicable to your problem?
lodin
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|