in reply to Re: Extract a small part of a long sentence using regular expressions
in thread Extract a small part of a long sentence using regular expressions

hi....elegant solution but please: where does the array hash figure....I see the %hash declaration but how is the array sigil used?
  • Comment on Re^2: Extract a small part of a long sentence using regular expressions

Replies are listed 'Best First'.
Re^3: Extract a small part of a long sentence using regular expressions
by choroba (Cardinal) on Dec 02, 2014 at 21:30 UTC
    It's called a hash slice. See Slices in perldata. The @ sigil just means plural, as -s in English, it doesn't necessarily mean "array".
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^3: Extract a small part of a long sentence using regular expressions
by Anonymous Monk on Dec 02, 2014 at 21:38 UTC

    { 'hashes', 'are', 'curly', 'ones' }

    [ 'arrays', 'are', 'square' ]

    ( 'lists are round' )

    my %foo; @foo{ 'hash', 'slices' } = ( 'use', 'curly braces' );

    my @bar; @bar[ 1,2,3,4 ] = ( 'array', 'slices', 'use', 'square brackets' );

    See also References quick reference