初学perl,字符串替换标量变量
1 #!/usr/bin/perl 2 $line = "hello"; 3 printf "${line}world\n"; 4 $width = <STDIN>; 5 printf "%${width}s\n",$line;
$line = "hello";printf "${line}world\n";chomp($width = <STDIN>);printf "%${width}s\n",$line;