Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

comment on

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

Do I misunderstand the question or will the following not work?

Edit: Ok, I misunderstand the nature of the problem as noted by LanX in Re^2: Distiguishing arguments: number-strings vs real integer... My apologies.

#!/usr/bin/perl use strict; use warnings; #use Data::Dump qw/pp dd/; #use Scalar::Util qw/looks_like_number/; #use Devel::Peek; sub is_string { my $arg = $_[0]; warn "$arg looks like number \n$&\n\n\n" if $arg =~ /(\d+)/; } is_string(1); is_string("42"); my $n=1; my $s="42"; my $s1="this contains the number 143"; my $s2 = "Awierd123number"; is_string($n); is_string($s); is_string($s1); is_string($s2); $n.=""; # cast to string $s+=0; # cast to number is_string($n); is_string($s);

...the majority is always wrong, and always the last to know about it...

A solution is nothing more than a clearly stated problem...

In reply to Re: Distiguishing arguments: number-strings vs real integer by wjw
in thread Distiguishing arguments: number-strings vs real integer by LanX

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 the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2020-04-08 19:16 GMT
    Find Nodes?
      Voting Booth?
      The most amusing oxymoron is:

      Results (45 votes). Check out past polls.