View Problem

Perform an action if a condition is true (IF .. THEN)

Given a variable name, if the value is "Bob", display the string "Hello, Bob!". Perform no action if the name is not equal.
DiskEdit
perl
if ($name eq "Bob") {
print "Hello, Bob!"
}
DiskEdit
perl
print "Hello, Bob!" if $name eq "Bob";
ExpandDiskEdit
java
if (name.equals("Bob")) {
System.out.println("Hello, Bob!");
}

Submit a new solution for perl or java
There are 19 other solutions in additional languages (clojure, cpp, csharp, erlang ...)