-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
69 lines (46 loc) · 2.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
NAME
Data::Define - Make undef's defined
SYNOPSIS
use Data::Define;
print define undef; # prints ''
use Data::Define qw/ brockets /;
print define undef; # prints '<undef>';
use Data::Define qw/ define_html brockets /;
print define_html undef; # prints '<undef>';
use Data::Define qw/ define_html div-class-undef /;
print define_html undef; # prints '<undef>';
DESCRIPTION
Data::Define
METHODS
define
This method takes one parameter and returns it defined even if it was
not defined primordially.
This method is exported by default.
Default return value is ''. If you asked to export 'brockets' using
Data::Define, return value becomes '<undef>'. You can specify your own
default value using Data::Define->"set_undef_value".
define_html
This method works exactly the same as 'define', but when exporting
'brockets', return value becomes '<undef*gt;', so you can send it to
HTML browser without need to escape.
Additionally, you can ask to export 'div-class-undef', then return value
will be '<div class="undef"></div>'.
You can specify your own default value using
Data::Define->"set_undef_value_html".
set_undef_value( $value )
This method allows you to specify your own default value for define.
Usage is "Data::Define->set_undef_value( $value )".
If $value is not defined, default value ('', or '<undef>' if 'brockets'
is exported) is used.
set_undef_value_html( $value )
This method allows you to specify your own default value for
define_html. Usage is "Data::Define->set_undef_value_html( $value )".
If $value is not defined, default value ('', or '<undef>' if
'brockets' is exported, or '<div class="undef"></div>' if
'div-class-undef' is exported) is used.
AUTHORS
Serguei Trouchelle <[email protected]>
COPYRIGHT
Copyright (c) 2006 Serguei Trouchelle. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.