Help for this page

Select Code to Download


  1. or download this
    perl -wle 'print ":" . XXX'
    
  2. or download this
    perl -wle '$_ = "345678"; print ":" . /./g'
    
  3. or download this
    perl -wle '$_ = "345678"; print ":" . ( () = /./g )'
    # output: ':6' (6 - number of matches; special behaviour)
    
  4. or download this
    perl -wle '$_ = "345678"; print ":" . @{[ /./g ]}'
    # output: ':6' (6 - number of matches => number of array elements)
    
  5. or download this
    perl -wle '$_ = "345678"; print ":" . @_{ /./g }'
    #Use of uninitialized value in concatenation (.) or string at -e line 
    +1.
    #:
    
  6. or download this
    perl -wle '$_ = "345678"; print ":" . ( /./g )[ 1 ]'
    # output: ':4' (second match for e.g. index 1)
    
  7. or download this
    perl -wle '$_ = "3" x 5e5; print ":" . method( XXX )'
    
  8. or download this
    perl -wle '$_ = "345678"; print ":" . ( /./g )[ [] ]'
    #Use of uninitialized value in concatenation (.) or string at -e line 
    +1.
    #:
    
  9. or download this
    perl -wle '$_ = "345678"; print ":" . ( /./g )[ undef ]'
    #Use of uninitialized value in list slice at -e line 1.
    #:3
    
  10. or download this
    perl -wle '$_ = "345678"; print ":" . ( /./g )[()]'
    #Argument ":" isn't numeric in list slice at -e line 1.
    #:3
    
  11. or download this
    perl -wle '$_ = "345678"; print ":" . ( /./g )[@_]'
    #Argument ":" isn't numeric in list slice at -e line 1.
    #:3
    
  12. or download this
    perl -wle '$_ = "345678"; print "2" . ( /./g )[()]'
    #25
    
  13. or download this
    perl -wle '$_ = "345678"; print "2" . ( /.(?{ print $& })/g )[()]'
    3
    ...
    7
    8
    25