tinymce bug fixes and a new function in Utility.pm
This commit is contained in:
parent
7578859801
commit
873ce1c62e
42 changed files with 449 additions and 194 deletions
|
|
@ -21,7 +21,7 @@ use strict;
|
|||
use Tie::IxHash;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomizeArray
|
||||
our @EXPORT = qw(&isBetween &makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomizeArray
|
||||
&sortHashDescending &sortHash &isIn &makeCommaSafe &makeArrayCommaSafe &randint &round);
|
||||
|
||||
|
||||
|
|
@ -75,6 +75,41 @@ sub commify {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isBetween ( value, first, second )
|
||||
|
||||
Returns true if value is between two other values (inclusive). Otherwise returns false.
|
||||
|
||||
=head3 value
|
||||
|
||||
An integer to compare against first and second.
|
||||
|
||||
=head3 first
|
||||
|
||||
An integer to compare value against.
|
||||
|
||||
=head3 second
|
||||
|
||||
Another integer to compare value against.
|
||||
|
||||
=cut
|
||||
|
||||
sub isBetween {
|
||||
my $value = shift;
|
||||
my $first = shift;
|
||||
my $second = shift;
|
||||
if ($first > $second) {
|
||||
my $temp = $first;
|
||||
$first = $second;
|
||||
$second = $temp;
|
||||
}
|
||||
if ($value >= $first && $value <= $second) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isIn ( value, list )
|
||||
|
||||
Returns a boolean value as to whether the value is in the array.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue