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

  • Home
  • SEARCH
  • 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 1017037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:38:29+00:00 2026-05-16T10:38:29+00:00

maybe this is a stupid question but : i run perl 5.8.8 and i

  • 0

maybe this is a stupid question but :
i run perl 5.8.8 and i need to replace any underscore preceded by a number, with “0”.

running :

 $var =~s /(\d)_/$10/g; 

obviously does not work as $10 is interpreted as… well… $10, not “$1 followed by 0”

moreover, as runing perl5.8, i can’t do

$var=~s/(?<n1>\d)\_/$+{n1}0/g;

any idea ?
thanks in advance

  • 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-16T10:38:29+00:00Added an answer on May 16, 2026 at 10:38 am

    Just like in various Unix shells, you can enclose the variable name in braces for disambiguation.

    $var =~s /(\d)_/${1}0/g;
    

    Or you can use a look-behind to prevent the digit from being part of the match:

    $var =~s /(?<=\d)_/0/g; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know, maybe this question is stupid but I am stuck and I need
Well, maybe it is a stupid question, but I cannot resolve this problem. In
This may be a stupid question to ask, but still I need to know
Maybe this is a very stupid question but... Why should I use tinytext and
Maybe this is a stupid question, but at the end of my pages i
I know maybe this is a stupid question, But i suck at sql But
This is maybe a stupid question to ask but I can't seem to find
Maybe this is a stupid question but it's bugging me. I have a bi-directional
Maybe this is a stupid question, but here I go :) I have two
maybe this is a stupid question, but i have seen many Tuts that build

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.