Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6166071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:16:34+00:00 2026-05-23T22:16:34+00:00

i am taking one variable $var2=\\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated; and want to change it to $var2=//hydfs00/PUBLIC1/DEV/pkumar/ITT_TEST_BUILD/CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated; I’m

  • 0

i am taking one variable
$var2="\\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated";

and want to change it to

$var2="//hydfs00/PUBLIC1/DEV/pkumar/ITT_TEST_BUILD/CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated";

I’m using syntax $var2 =~ s/\\/\//g; for changing this. but the output is coming like /hydfs00PUBLIC1DEVpkumarITT_TEST_BUILDCS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated

please help me out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:16:35+00:00Added an answer on May 23, 2026 at 10:16 pm

    "\\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated" is a mistake:

    Unrecognized escape \P passed through at …
    Unrecognized escape \D passed through at …
    Unrecognized escape \p passed through at …
    Unrecognized escape \I passed through at …
    Unrecognized escape \C passed through at …
    

    It evaluates to \hydfs00PUBLIC1DEVpkumarITT_TEST_BUILDCS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated.

    You want to single-quote the string in order to restrict backslash-escaping to backslashes and single quotes only. '\\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated' evaluates to \hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated.

    Let’s properly escape the backslashes at the beginning so we get two backslashes. '\\\\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated' evaluates to \\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated. This is the string you intended.

    Now we can operate on the value.

    my $var = '\\\\hydfs00\PUBLIC1\DEV\pkumar\ITT_TEST_BUILD\CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated';
    $var =~ s{ \\ }{/}gx; # replace any single backslash with a single slash
    # $var now has the value
    # //hydfs00/PUBLIC1/DEV/pkumar/ITT_TEST_BUILD/CS2.1_PROD_TEST_40550_LG_LC_Java_sp36_obfuscated
    

    This is all newbie stuff. Go learn the language, read a book or two.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am taking the amount from one input box and creating a for...each loop
Our build server is taking too long to build one of our C++ projects.
I am finalizing one of my projects and taking a look over the whole
Inserting rows one by one from a 600 record data-set is taking almost an
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in
I'm trying to figure out why one of our migration scripts is taking forever
I'm a blind student who's taking a required UI class. One of the assignments
I start to use Java annotations heavily. One example is taking method with annotations
I'm trying to make a generic function taking a variable argument list. A part
I'm working on one application ( using PHP, javascript ). Below is the short

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.