Skip to main content
added 96 characters in body
Source Link
user12166
user12166

Perl

$r = 1; for(1           # r gets one for one
.. pop @ARGV) { $r *=   # to pop arg v r splat gets
$_; } print $r;         # the default print r

Toss this into a file named 'f.pl' (doesn't matter, just how I ran it below)f.pl

And the output:

$ perl f.pl 03
1$6$ perl f.pl 31-1
6$1$ perl f.pl 10
3628800$ 

Which is read as:


perl f p l three
perl f p l one less one
perl f p l ten

Perl

$r = 1; for(1           # r gets one for one
.. pop @ARGV) { $r *=   # to pop arg v r splat gets
$_; } print $r;         # the default print r

Toss this into a file named 'f.pl' (doesn't matter, just how I ran it below)

And the output:

$ perl f.pl 0
1$ perl f.pl 3
6$ perl f.pl 10
3628800$

Perl

$r = 1; for(1           # r gets one for one
.. pop @ARGV) { $r *=   # to pop arg v r splat gets
$_; } print $r;         # the default print r

Toss this into a file named f.pl

And the output:

$ perl f.pl 3
6$ perl f.pl 1-1
1$ perl f.pl 10
3628800$ 

Which is read as:


perl f p l three
perl f p l one less one
perl f p l ten
Post Undeleted by CommunityBot
Fix syllable count
Source Link
user12166
user12166

Perl

$r = 1; for(1           # r isgets one for one
.. $ARGV[0]pop @ARGV) { $r *=   # to pop arg v zero r timessplat equalsgets
$_; } print $r;         # the default print r

Toss this into a file named 'f.pl' (doesn't matter, just how I ran it below)

And the output:

$ perl f.pl 0
1$ perl f.pl 3
6$ perl f.pl 10
3628800$

Perl

$r = 1; for(1         # r is one for one
.. $ARGV[0]) { $r *=  # to arg v zero r times equals
$_; } print $r;       # the default print r

Toss this into a file named 'f.pl' (doesn't matter, just how I ran it below)

And the output:

$ perl f.pl 0
1$ perl f.pl 3
6$ perl f.pl 10
3628800$

Perl

$r = 1; for(1           # r gets one for one
.. pop @ARGV) { $r *=   # to pop arg v r splat gets
$_; } print $r;         # the default print r

Toss this into a file named 'f.pl' (doesn't matter, just how I ran it below)

And the output:

$ perl f.pl 0
1$ perl f.pl 3
6$ perl f.pl 10
3628800$
Post Deleted by CommunityBot
Source Link
user12166
user12166

Perl

$r = 1; for(1         # r is one for one
.. $ARGV[0]) { $r *=  # to arg v zero r times equals
$_; } print $r;       # the default print r

Toss this into a file named 'f.pl' (doesn't matter, just how I ran it below)

And the output:

$ perl f.pl 0
1$ perl f.pl 3
6$ perl f.pl 10
3628800$