Hi,

I was looking at https://github.com/Perl/perl5/issues/22118 and, on perl-5.39.9 devel release, went looking for the difference between calling builtin::stringify() and scalar().
This somewhat simplistic little script failed to find any difference:
use strict; use warnings; use experimental qw(builtin); my @x = qw(one two three); my $_1st = builtin::stringify @x; my $_2nd = scalar @x; print $_1st, "\n", $_2nd, "\n\n"; $_1st = builtin::stringify "@x"; $_2nd = scalar "@x"; print $_1st, "\n", $_2nd, "\n\n"; print builtin::stringify @x, "\n"; print scalar @x, "\n\n"; print builtin::stringify "@x", "\n"; print scalar "@x", "\n\n"; # UPDATE: remove duplicate test #print builtin::stringify @x, "\n"; #print scalar @x, "\n\n";
Presumably, there are circumstances where builtin::stringify() and scalar() are not the same thing .... right ???

Cheers,
Rob

In reply to Does the experimental builtin::stringify() do anything that scalar() doesn't ? by syphilis

Title:
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, details, 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, summary, 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.