projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tidy up listdups so regexes now work again
[spider.git]
/
perl
/
DXChannel.pm
diff --git
a/perl/DXChannel.pm
b/perl/DXChannel.pm
index 8b71dbff499d7946a83378b2938f6c54f6ea41c4..7a27a8f2bc3bd3a90eda6efaaf388e9c6bc312fc 100644
(file)
--- a/
perl/DXChannel.pm
+++ b/
perl/DXChannel.pm
@@
-286,7
+286,7
@@
sub send_now
my $call = $self->{call};
for (@_) {
my $call = $self->{call};
for (@_) {
-
chomp;
+
#
chomp;
my @lines = split /\n/;
for (@lines) {
$conn->send_now("$sort$call|$_");
my @lines = split /\n/;
for (@lines) {
$conn->send_now("$sort$call|$_");
@@
-307,7
+307,7
@@
sub send # this is always later and always data
my $call = $self->{call};
for (@_) {
my $call = $self->{call};
for (@_) {
-
chomp;
+
#
chomp;
my @lines = split /\n/;
for (@lines) {
$conn->send_later("D$call|$_");
my @lines = split /\n/;
for (@lines) {
$conn->send_later("D$call|$_");
@@
-466,8
+466,13
@@
sub AUTOLOAD
$name =~ s/.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
$name =~ s/.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
- @_ ? $self->{$name} = shift : $self->{$name} ;
+
+ # this clever line of code creates a subroutine which takes over from autoload
+ # from OO Perl - Conway
+ *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
+ @_ ? $self->{$name} = shift : $self->{$name} ;
}
}
+
1;
__END__;
1;
__END__;