Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

The golf course looks great, my swing feels good, I like my chances (Part VI)

by eyepopslikeamosquito (Chancellor)
on Dec 30, 2009 at 10:14 UTC ( #814900=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    print$"x(318%$_/9),(($_-$`)%12?o:x)&($_%12^$'/5?o:'}'),$/x($_/85)for u
  2. or download this
  3. or download this
  4. or download this
  5. or download this
  6. or download this
    "Dear $name"              # Perl and PHP
    "Dear %s" % expr          # Python and Ruby % printf-like operator
    "Dear #{expr}"            # Ruby string interpolation
    "Dear @{[expr]}"          # Perl "Baby Cart" string interpolation
    "Dear {expr}"             # Perl 6 version of Baby Cart (I think)
  7. or download this
    "for map{$_,11-$_}<>!~/:/..5
  8. or download this
    "X" * 5               Python
    "X" * 5               Ruby
    "X" x 5               Perl
    str_repeat("X", 5)    PHP
  9. or download this
    5 * "X"    also produces "XXXXX" in Python! TMTOWTDI! :)
    5 * "X"    ... but not in Ruby (won't compile: type error)
    5 x "X"    ... or Perl (produces empty string)
  10. or download this
    $"x(318%$_/9)        Perl
    " "*(318%i/9)        Ruby
    318%i/9*" "          Python
  11. or download this
    for c in'XXXXXXXXXXXX':i=ord(c);print~60495%i/4*" "+'hxmo'[(i%12==int(
  12. or download this
    for c in'XXXXXXXXXXXX':i=ord(c);print~60495%i/4*" "+'ohxm'[-(i%12==int
  13. or download this
    print 318%i/9
  14. or download this
  15. or download this

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://814900]
Approved by Corion
Front-paged by Corion
[Lady_Aleena]: perl -e 'my $var = "1.0"; print $var;' if it is in a variable also returns 1.0, though perl -e 'my $var = 1.0; print $var;' returns 1.
[1nickt]: In my case I can simply pass sprintf '%.1f', 1.0 (to Types::Standard:: Int), but what if you didn;t know the precision of the number you were working with? Seems I must be missing something. Oh well, my test list is complete, mooving on ...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2017-05-24 18:51 GMT
Find Nodes?
    Voting Booth?