Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: simplifying substitution

by Polyglot (Chaplain)
on Mar 08, 2021 at 14:18 UTC ( [id://11129333]=note: print w/replies, xml ) Need Help??


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

I get this output from that command (I'm not on Windows):

Bareword found where operator expected at -e line 1, near "s/ /v/r" Unquoted string "r" may clash with future reserved word at -e line 1. Can't modify string in substitution (s///) at -e line 1, near "s/ /v/r " syntax error at -e line 1, near "s/ /v/r " Execution of -e aborted due to compilation errors.

When I check the version, I get this:

perl -v This is perl 5, version 12, subversion 4 (v5.12.4) built for darwin-th +read-multi-2level (with 2 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall

Blessings,

~Polyglot~

Replies are listed 'Best First'.
Re^5: simplifying substitution
by choroba (Cardinal) on Mar 08, 2021 at 14:23 UTC
    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]
      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]

Log In?
Username:
Password:

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

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

    No recent polls found