Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

(update: the first one has been edited to fix problems/bad style since I first pressed submit. Oopsie.)

use strict; my @result; my $one = "a" =~ /./; sub add { my($vA,$vB) = @_; ($vA,$vB) = ($vA^$vB,($vA&$vB)<<$one) while $vB; return $vA; } my $val = $one; do { push @result, $val; $val = add($val,$one); } until $one.$one eq $val;

... or, without any lines preceeding it in the file it's in ...

sub f { die if $::f_A; die if $::f_B; die if $::f_C; die if $::f_D; die if $::f_E; die if $::f_F; die if $::f_G; die if $::f_H; die if $::f_I; die if $::f_J; } my @vars = map { "::f_$_" } qw(A B C D E F G H I J); my @result; foreach (@vars) { $$_ = "true"; eval { f() }; push @result, $@ =~ /line ([^.]+)\./; $$_ = undef; }

update: A very, very cheap solution: (doesn't work on EBCDIC systems, sorry)

my @result = split " ", "pasarauatawavayaxapq"^"AAAAAAAAAAAAAAAAAAAA";

In reply to Re: TMTOWTDI Puzzle: Generating a range of numbers by wog
in thread TMTOWTDI Puzzle: Generating a range of numbers by Masem

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (4)
    As of 2018-05-22 19:53 GMT
    Find Nodes?
      Voting Booth?