how to change string to integer in perl
my $stri = "100";
#convert
$stri = int($stri);
print "$string\n";
or
my $str = "100";
# convert
$stri = sprintf("%d", $stri);
print "$stri\n";
#convert
$stri = int($stri);
print "$string\n";
or
my $str = "100";
# convert
$stri = sprintf("%d", $stri);
print "$stri\n";
Comments
Post a Comment