<p>In Python, if I do this:</p>

<pre><code>print "4" * 4
</code></pre>

<p>I get</p>

<pre><code>&gt; "4444"
</code></pre>

<p>In Perl, I'd get</p>

<pre><code>&gt; 16
</code></pre>

<p>Is there an easy way to do the former in Perl?</p>

```
```
$ perl -e 'print "4" x 4; print "\n"'
4444
```
```
The x operator is documented in perldoc
perlop
. Here binary means an operator taking two arguments, not composed of bits, by the way.
Binary "x" is the repetition operator. In scalar context or if the
left operand is not enclosed in parentheses, it returns a string consisting
of the left operand repeated the number of times specified by the right
operand. In list context, if the left operand is enclosed in parentheses
or is a list formed by "
```
qw/STRING/
```
", it repeats the list. If the right
operand is zero or negative, it returns an empty string or an empty
list, depending on the context.
```
```
print '-' x 80;             # Print row of dashes

       print "\t" x ($tab/8), ' ' x ($tab%8);      # Tab over

       @ones = (1) x 80;           # A list of 80 1’s
       @ones = (5) x @ones;        # Set all elements to 5
```
```
```
perl -e
```
is meant to execute Perl code from the command line:
```
$ perl --help
Usage: perl [switches] [--] [programfile] [arguments]
  
  -e program     one line of program (several -e's allowed, omit programfile)
```