[system] / trunk / pg / lib / PGcore.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/PGcore.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 6251 Revision 6252
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: pg/macros/PG.pl,v 1.40 2009/06/25 23:28:44 gage Exp $ 4# $CVSHeader: pg/lib/PGcore.pm,v 1.1 2010/05/14 11:39:02 gage Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
31use Tie::IxHash; 31use Tie::IxHash;
32 32
33################################## 33##################################
34# Utility macro 34# Utility macro
35################################## 35##################################
36
37=head2 Utility Macros
38
39 not_null(item) returns 1 or 0
40
41 empty arrays, empty hashes, strings containing only whitespace are all NULL and return 0
42 all undefined quantities are null and return 0
43
44
45=cut
36 46
37sub not_null { # empty arrays, empty hashes and strings containing only whitespace are all NULL 47sub not_null { # empty arrays, empty hashes and strings containing only whitespace are all NULL
38 my $item = shift; 48 my $item = shift;
39 return 0 unless defined($item); 49 return 0 unless defined($item);
40 if (ref($item)=~/ARRAY/) { 50 if (ref($item)=~/ARRAY/) {

Legend:
Removed from v.6251  
changed lines
  Added in v.6252

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9