Originally, a crude name was proposed for this operator, as indicated by this response from BooK to Sebastien Aperghis-Tramoni:

> Hey Philippe, why don't you give the name we found for @{[]} ?

Because *you* found it, and want to have *my* name associated with it.

To deflect attention from the taboo name, BooK started another fwp thread, suggesting "Baby Cart" ... which was objected to by native English speakers on the grounds they'd never heard it used in everyday speech. Suggested alternatives included "Baby Carriage" and "Pram". Though many other names have been proposed, including:

it seems that BooK's quirky Baby Cart has won this fascinating naming war.

BooK References

Quoting BooK from Interview with Philippe Bruhat (August 2015):

I've been hanging around on the Fun with Perl mailing for a long time, and this is where José Castro started to ask for the names of the most famous secret operators for his OGSOP (Obfuscation, Golfing and Secret Operators in Perl) book project. I came up with the name "baby cart" for @{[]}, and I loved that name so much that I wanted to make sure it would be the one that everyone would use. The only way to do that was to write the reference manual myself...

Early Historical References

References Added Later

Comparing Baby Cart with String Interpolation in Other Languages (Golf)

Though usually too long for golf, Baby Cart occasionally features in competitive golf solutions, as you will discover by searching for Baby Cart in the following nodes:

Based on these nodes, consider how to create a "Dear John" string in each of the four languages:

"Dear $name" # Perl and PHP "Dear %s" % expr # Python and Ruby % printf-like operator "Dear {0}".format(expr) # Python format string method "Dear "+`expr` # Python backticks (TMTOWTDI) "Dear #{expr}" # Ruby string interpolation "Dear @{[expr]}" # Perl "Baby Cart" string interpolation "Dear {expr}" # Perl 6 version of Baby Cart (I think)

My 102 stroke Perl solution to the Saving Time challenge used Baby Cart to create a printf format string on the fly:

printf"%@{[.1*vec'XXXXXXXXXXXX',$_,8]}s",($_^$`%12?g:p)&($_^$'/5?g:u)| +"H "for map{$_,11-$_}<>!~/:/..5

What's the shortest way to create this peculiar printf format string from an expression (expr) in each of the four languages?

TechniquePerlRubyPythonPHP
String interpolate"%@{[expr]}s""%#{expr}s""%%%ds"%expr~X.expr.s
Number of strokes1311129

where X above is the character with ord value 218. Poor old Baby Cart baby-stepped to the finish line in last place in this oddball race. This is hardly surprising given Baby Cart was not really designed; it was independently "invented" shortly after Perl 5 was released in 1994 by both L.Wall and R.Schwartz ... and later celebrated as one of Perl's secret operators.

Updated: Many changes were made and extra references added long after the original response was made.


In reply to Re^3: Hidden features of Perl (Baby Cart Secret Operator) by eyepopslikeamosquito
in thread Hidden features of Perl by vxp

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.