Hi AM,
use strict;
use warnings;
use Data::Dumper;
my @t = map {$_ * ($_+ ($_- 1) ) % 4} (2, 3, 4);
print '@t: ', Dumper(\@t), "\n"; # 2 3 0
my $i = chr(0x34); # '4'
print "\$i: $i\n";
my $five = chr(55); # '7'
print "\$five: $five\n";
print "$i$five " . ($t[0] + $t[1]) . ($i / 2) . "." . $t[0] . chr(0x35
+) . ($t[0] * 3 + 1) . "\n";
my @x = map { (srand(1) * $_) % 9 } (28, 34, 57);
print '@x: ', Dumper(\@x), "\n"; # 1 7 3
print $x[0] . ($x[0] * 2) . ($x[0] * 2 * 2 / 2) . " " . chr(48) . ($x[
+2] * 3) . "." . ($x[2] + 1) . chr(0x30) . (($x[1] % 4) - 3) . "\n";
The output for me is
47 52.257
122 09.400
HTH
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|