Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created February 3, 2009 13:11
Show Gist options
  • Save ukstudio/57520 to your computer and use it in GitHub Desktop.
Save ukstudio/57520 to your computer and use it in GitHub Desktop.
BEGIN {
$a = 10
puts "begin1 #{$a}"
}
BEGIN {
$a = 20
puts "begin2 #{$a}"
}
puts $a
END {
$a = 30
puts "end1 #{$a}"
}
END {
$a = 40
puts "end2 #{$a}"
}
#=> begin1 10
#=> begin2 20
#=> 20
#=> end2 40
#=> end1 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment