On Sat, Dec 10, 2011 at 20:37, Thierry Vignaud
<thierry.vign...@gmail.com> wrote:
> On 10 December 2011 20:25, Romain d'Alverny <rdalve...@gmail.com> wrote:
>>>    if ((@info{qw(name version release variant arch medium build
>>> ext)}) = $name =~
>>>        
>>> m/^(Mageia)-(\d+)-((?:alpha|beta|RC)\d*)?(-(?:.*))?-(i586|x86_64|dual)?(?:-(CD|DVD|BD))?(?:-(build_\w+))?\.(.*)$/)
>>> {
>>>        $info{full} = $name;
>>>    }
>>
>> Looks much more compact, thanks. Added a "else { %info = (); }" to
>> satisfy the expected behaviour (empty array returned if no match).
>
> This is wrong.
> Once declared (aka "my %info"), %info is initialized and is equal to "()".

Yes, but otherwise, testing the code you provided, even if the regexp
test fails, returned %info is still populated with keys, pointing to
undef values.

>> By the way, is there a "best" Web-based doc for MDK Perl libraries?
>> (could find one, but not at once, and I didn't count many). Or shall
>> we think about it?
>
> perldoc MDK::Common

Thanks, this is cool for a local access. Looking for a way to export
this into HTML.

Reply via email to