summaryrefslogtreecommitdiff
path: root/databases/p5-Class-DBI-AsForm/files/500503-AsForm.pm
blob: e60c14f5cfba269aa0adde800f42b0da20851c3f (plain) (blame)
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
--- AsForm.pm.orig	Sat Apr  3 22:37:32 2004
+++ AsForm.pm	Sat Apr  3 22:37:38 2004
@@ -1,16 +1,14 @@
 package Class::DBI::AsForm;
-use 5.006;
 use strict;
-use warnings;
 use Class::DBI::Plugin::Type ();
-our $OLD_STYLE = 0;
+use vars qw($OLD_STYLE);$OLD_STYLE = 0;
 
 use HTML::Element;
 require Exporter;
-our @ISA = qw(Exporter);
-our @EXPORT = qw( to_cgi to_field _to_textarea _to_textfield _to_select
+use vars qw(@ISA);@ISA = qw(Exporter);
+use vars qw(@EXPORT);@EXPORT = qw( to_cgi to_field _to_textarea _to_textfield _to_select
 type_of );
-our $VERSION = '2.3';
+use vars qw($VERSION);$VERSION = '2.3';
 
 =head1 NAME
 
@@ -100,14 +98,14 @@
 sub _to_textarea {
     my ($self, $col) = @_;
     my $a = HTML::Element->new("textarea", name => $col);
-    if (ref $self) { $a->push_content($self->$col) }
+    if (ref $self) { $a->push_content($self->$col()) }
     $OLD_STYLE && return $a->as_HTML;
     $a;
 }
 
 sub _to_textfield {
     my ($self, $col) = @_;
-    my $value = ref $self && $self->$col;
+    my $value = ref $self && $self->$col();
     my $a = HTML::Element->new("input", type=> "text", name => $col);
     $a->attr("value" => $value) if $value;
     $OLD_STYLE && return $a->as_HTML;
@@ -122,7 +120,7 @@
     for (@objs) { 
         my $sel = HTML::Element->new("option", value => $_->id);
         $sel->attr("selected" => "selected") if ref $self 
-                                                and eval { $_->id eq $self->$col->id };
+                                                and eval { $_->id eq $self->$col()->id };
         $sel->push_content($_->stringify_self);
         $a->push_content($sel);
     }