package Pastel
::Mixin
::Mixin
;
# The sole purpose of the existance of this module is to provide some low
# level functionality to the Pastel package. This module is automatically called
# I liked this method from the bioperl modules. I just lifted it verbatim. Great works
my($self,$order,@param) = @_;
return @param unless (defined($param[0]) && $param[0]=~/^-/);
for (my $i=0;$i<@param;$i+=2) {
# Now we'll convert the @params variable into an associative array.
local($^W
) = 0; # prevent "odd number of elements" warning with -w.
# What we intend to do is loop through the @{$order} variable,
# and for each value, we use that as a key into our associative
# array, pushing the value at that key onto our return array.
foreach $key (@
{$order}) {
my($value) = $param{$key};
push(@return_array,$value);
# print "\n_rearrange() after processing:\n";
# my $i; for ($i=0;$i<@return_array;$i++) { printf "%20s => %s\n", ${$order}[$i], $return_array[$i]; } <STDIN>;
# my $indent_level = $self->{_indent_level};
my $indent_type = " "; # 4 spaces indent
my $indent = $indent_type x $self->{_indent_level};
$self->{_indent_level}++;
#print "Increase indent\n";
#print $self->{_indent_level};
while ($data =~ /\/>/gi ){
$self->{_indent_level}--;
#print $self->{_indent_level};
while ($data =~ /<\//gi ){
$self->{_indent_level} -= 2;
#print $self->{_indent_level};