123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
# # A module to allow a user to create and (eventually) edit arrays of # text and attributes # # This is used for creating mail messages and user script files # # It may be sub-classed # # Copyright (c) 2001 Dirk Koopman G1TLH # # $Id: Editable.pm,v 1.4 2002/07/29 15:41:50 minima Exp $ # package Editable; use strict; use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/ ); $BRANCH = sprintf( "%d.%03d", q$Revision: 1.4 $ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); $main::build += $VERSION; $main::branch += $BRANCH; use DXChannel; use DXDebug; use BadWords; sub new { my $pkg = shift; my $class = ref $pkg || $pkg; return {@_}, $class; } sub copy { my $self = shift; return $self->new(%$self); } sub addline { my $self = shift; my $dxchan = shift; my $line = shift; if (my @ans = BadWord::check($line)) { return ($dxchan->msg('e17', @ans)); } push @{$self->{lines}}, $line; return (); } sub modline { my $self = shift; my $dxchan = shift; my $no = shift; my $line = shift; if (my @ans = BadWord::check($line)) { return ($dxchan->msg('e17', @ans)); } ${$self->{lines}}[$no] = $line; return (); } sub lines { my $self = shift; return exists $self->{lines} ? (@{$self->{lines}}) : (); } sub nolines { my $self = shift; return exists $self->{lines} ? scalar @{$self->{lines}} : 0; } 1;
About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us
©2009 Koders is a trademark of Black Duck Software, Inc. Black Duck, Know Your Code and the Black Duck logo are registered trademarks of Black Duck Software, Inc. in the United States and other jurisdictions. All other trademarks are the property of their respective holders.