Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 imbibing at the Monastery: (5)
As of 2020-10-24 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (242 votes). Check out past polls.

    Notices?