Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: following if condition fails to print its variable using perl?

by finddata (Sexton)
on Mar 15, 2017 at 09:27 UTC ( #1184667=note: print w/replies, xml ) Need Help??


in reply to Re^3: following if condition fails to print its variable using perl?
in thread following if condition fails to print its variable using perl?

Error: when i prints these statements. print 'name :$name', ((exists $name_map->{$name} ) ? "is in hash" : "is not in hash"), "\n";
name :$nameis in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash name :$nameis not in hash
  • Comment on Re^4: following if condition fails to print its variable using perl?
  • Download Code

Replies are listed 'Best First'.
Re^5: following if condition fails to print its variable using perl?
by huck (Parson) on Mar 15, 2017 at 09:58 UTC

    print 'name :$name' uses single quotes and the $ is just text, try print 'name :'.$name or print "name :$name"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2020-01-28 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?