Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hey there my fellow esteemed Monks!

I've been having a long-running problem that I'm finally fed up enough with to ask for help.

In my test suite for berrybrew, I perform a path substitution in a configuration file before the tests load. The specific command which is run out of a batch script looks like this:

call perl -i.bak -ne "s/berrybrew(?!\\+test)/berrybrew\\test/; print" +test/data/config.json

Essentially, that's supposed to change the path C:\berrybrew to C:\berrybrew\test.

On some of my Windows 10 systems, it works just fine, and everything goes on its merry way. On other Win10 systems, the change results in a tab character being inserted, so the path looks like this: C:\berrybrew[TAB]est. If I insert four backslashes in the replacement (ie. berrybrew\\\\test, it works. However, after a git push then a git pull on the other systems that work with just the two backslashes, it breaks.

What can I do to provide myself some consistency across systems? Is there some unicode trick or something I can use? I've tried replacing the forward slashes in the substitution to single-quotes (eg: s///; to s''';) to no avail.

I'd really like to get this resolved so that the substitution works reliably across all systems.

Cheers,

-stevieb


In reply to Windows and backslashes and replacements oh my! by stevieb

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



  • 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 or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-05-23 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?