Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks, I knew that construct and that SO thread already.

Actually that's exactly how I inserted the "DISABLED" part, see demo here.

Problem is that, like already explained, I would need to know all possible entries beforehand instead of being able to exclude anything following C:\perls\...

I also looked into batch solutions to split on ; and loop over it. But that's not trivial because, believe it or not, a ";" could be part of a filename° and appending to a variable in a loop is not trivial in WinB*tch language... 🤦

In short: batch is really a horrible language for a perverted file-system invented by a distorted sadist. ˛

I'm thinking now it's a good bargain between mental sanity, maintainability and performance to use a Perl one-liner returning the cleaned path. But only called for that edge case, i.e. if batch detects C:\perls in the path.

(I could also use PowerShell, but why adding one more technology at that place?)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) tho, I could ignore this problem as long as the paths of my Perl installations are clean, which goes without saying.

˛) I have to apologize that was too harsh.

It's rather a mix of the worst parts of bash and zsh, with the source google translated to Chinese and back to English but via Khoisan, while purging all documentation during compilation with random settings.


In reply to Re^2: Cleaning %PATH% with WinBatch by LanX
in thread Cleaning %PATH% with WinBatch by LanX

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 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?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found