In Python, if I do this:
print "4" * 4
I get
> "4444"
In Perl, I'd get
> 16
Is there an easy way to do the former in Perl?
operatorsperlrepeatstring
In Python, if I do this:
print "4" * 4
I get
> "4444"
In Perl, I'd get
> 16
Is there an easy way to do the former in Perl?
Best Solution
The x operator is documented in perldoc perlop. Here binary means an operator taking two arguments, not composed of bits, by the way.
perl -e
is meant to execute Perl code from the command line: