Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: simplifying substitution

by choroba (Cardinal)
on Mar 08, 2021 at 14:23 UTC ( [id://11129334]=note: print w/replies, xml ) Need Help??


in reply to Re^4: simplifying substitution
in thread simplifying substitution

OK, 5.12 doesn't have /r. So what about
perl -lwe '$v = qq( $]); $v =~ s/ /v/; print $v'
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^6: simplifying substitution
by Polyglot (Chaplain) on Mar 08, 2021 at 14:50 UTC
    perl -lwe '$v = qq( $]); $v =~ s/ /v/; print $v' v5.012004

    Blessings,

    ~Polyglot~

      See? Space works on the match side.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        Maybe the context affects it? Command line operation different? In any case, I wasted three+ hours today because I'd neglected to replace a space character with a "\s" in one of my matches. It was just a space, too...not a tab, return, or anything else. It was an HTML tag of the form <span class=" body"> and I had only put the \s in one of the two spaces....ooops. Three hours for a space. It really doesn't help to have folk like yourself tell me that it wasn't supposed to happen that way. Ha. So, can you tell me why perl is so fickle?

        And, no, I'm not planning to upgrade it. Too much work and too much risk with all I've got going.

        EDIT: I just realized what it must have been. I just re-read your earlier post, and you mentioned "without the /x"...well, I would have been using the /x. That must have been the crucial bit here.

        Blessings,

        ~Polyglot~

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-26 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found