Perl snippets
Category: /knowledge /developmentTags: development
Get parameters from command line
print $ARGV[0], $ARGV[1]
Opne/Read a file
open FILE, $fn or die $!;
my $text=join('', <FILE> );
my $total_length=length $text;
print "read file $fn, total size=$total_length";
close FILE;
substring
while ($idx<$total_len){
print substr $string, $index, $length
}