Skip to content

Instantly share code, notes, and snippets.

@ksexton
Created April 19, 2013 14:42
Show Gist options
  • Save ksexton/5420787 to your computer and use it in GitHub Desktop.
Save ksexton/5420787 to your computer and use it in GitHub Desktop.
$my_word = "foo"
$word = "foo"
## Pick the if statement
# if $my_word =~ /word/ {
# if $my_word =~ /${word}/ {
# if $my_word =~ /"${word}"/ {
# if $my_word =~ /#{word}/ {
notify { "${my_word} has ${word} in it":}
}
else {
notify { "${my_word} doesn't have ${word} in it":}
}
# Output:
# $ puppet apply regex.pp
# Notice: foo doesn't have foo in it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment