I'm making a perl module mainly out of boredom but also I'm touching up my OO skills and in the module I use......
$args{SHOW_BLANK} == 0 and next if !$ENV{$_};
$env .= qq|$_ : $ENV{$_}\n|;
}.........and was just wondering if there is any great speed difference between that and....
$args{SHOW_BLANK} == 0 and next if !$value;
$env .= qq|$key : $value\n|;
}
......or is it insignificant?
It's great fun writing modules.....I've not made many but I'm just finding the joys of doing so!
The module I'm writing currently allows for easy showing of the %ENV's in different formats using something like:
my $env = new ENV;
print $env->print_env(STYLE => 'normal', SHOW_BLANK => 0, FONT => 'verdana', FONT_SIZE => 12);
Useless I hear you cry.......well yes it is but it makes printing %ENV's much quicker and is just fun to play about with.
Code:
foreach (sort keys %ENV) { $args{SHOW_BLANK} == 0 and next if !$ENV{$_};
$env .= qq|$_ : $ENV{$_}\n|;
}
Code:
while (($key, $value) = each %ENV) { $args{SHOW_BLANK} == 0 and next if !$value;
$env .= qq|$key : $value\n|;
}
......or is it insignificant?
It's great fun writing modules.....I've not made many but I'm just finding the joys of doing so!
The module I'm writing currently allows for easy showing of the %ENV's in different formats using something like:
my $env = new ENV;
print $env->print_env(STYLE => 'normal', SHOW_BLANK => 0, FONT => 'verdana', FONT_SIZE => 12);
Useless I hear you cry.......well yes it is but it makes printing %ENV's much quicker and is just fun to play about with.