Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: $1[

by holli (Abbot)
on Oct 10, 2017 at 19:48 UTC ( [id://1201117]=note: print w/replies, xml ) Need Help??


in reply to $1[

You are using a screwdriver to stab someone. While that is also deadly, the right tool makes a much cleaner cut:
$_ =~ tr/()/[]/;


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^2: $1[
by rsFalse (Chaplain) on Oct 10, 2017 at 19:59 UTC
    Problem I was solving was more complicated, I only left some context in which I have used square brackets. I've simplified for show a problem of interpreting '$1[', which looks to me as a bug.

      No, for sure it is not a bug. When in doubt use the ${name} form inside of double quoted strings, or other contexts with similar rules. This could have happened with a var named $foo

      demerphq (dmq but i can't be bothered to log in)

        That was me. Can't even remember my account name apparently. :-)

        ---
        $world=~s/war/peace/g

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1201117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found