SHARE
TWEET

Use of undef in perl

a guest May 18th, 2011 91 Never
  1. $foo = 10;
  2.  
  3. if ($foo == undef) {
  4.     printf("foo : It's undefined");
  5. } else {
  6.     printf("foo : It's defined");
  7. }
  8.  
  9. printf("\n");
  10.  
  11. if ($bar == undef) {
  12.     printf("bar : It's undefined");
  13. } else {
  14.     printf("bar : It's defined");
  15. }
RAW Paste Data
Top