Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: tr operator in eval -- updated

by tybalt89 (Prior)
on Sep 26, 2020 at 07:49 UTC ( #11122231=note: print w/replies, xml ) Need Help??


in reply to tr operator in eval -- updated

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11122227 use warnings; my $kards = -99; my $bad="AKQJT98765432KKKK"; my $card='K'; # this next bit works. xtr is just so I can print what eval is eval in +g. my $xtr = "$bad =~ tr/$card//;" ; $kards = eval "\$bad =~ tr/$card//"; # missing \ , no ; needed inside +eval print "xtr kards = $kards from eval cmd : $xtr\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2021-06-15 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (74 votes). Check out past polls.

    Notices?