Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Substr Problem

by Athanasius (Chancellor)
on Sep 27, 2012 at 02:19 UTC ( #995906=note: print w/replies, xml ) Need Help??

in reply to Substr Problem

Hello snape,

GrandFather’s solution is definitely the way to go. However, for the record, your code can be made to give the output you want by changing the substitution:

substr($VALUE, 2, 2) =~ s/0/$signal/g;

into a simple assignment:

substr($VALUE, 2, 3) = $signal;

By the way, the /g modifier on the substitution is redundant in this case.

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Substr Problem
by choroba (Bishop) on Sep 27, 2012 at 08:32 UTC
    Or, even simpler:
    substr $VALUE, 2, 3, $signal;
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995906]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-10-18 08:05 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (243 votes). Check out past polls.