in reply to File splitting script

Nice.

This seems to be the same idea as the UNIX tool split. Which, by the way, as a pure Perl implementation in the Perl Power Tools project.

Um... This seems rather awkward:

if($chunk_size=~/(\d+)([mMgG])/) { my $numb=$1; my $tp=$2; SW: { ($tp eq "g" || $tp eq "G") && do { $numb*=1024*1024*1024; $size=$numb; last SW; }; ($tp eq "m" || $tp eq "M") && do { $numb*=1024*1024; $size=$numb; last SW; }; } } else { $size=$chunk_size; }

I think the following would be bit more natural:

if ( $chunk_size =~ /(\d+)g/i ) { $size = $1 * 1024*1024*1024; } elsif ( $chunk_size =~ /(\d+)m/i ) { $size = $1 * 1024*1024; } else { $size = $chunk_size; }

Of course, it could be further succinctified:

$size = $chunk_size =~ /(\d+)g/i ? $1 * 1024*1024*1024 : $chunk_size =~ /(\d+)m/i ? $1 * 1024*1024 : $chunk_size =~ /(\d+)k/i ? $1 * 1024 : # easy additio +n $chunk_size;
A word spoken in Mind will reach its own level, in the objective world, by its own weight