[Mageia-dev] [soft-commits] [2359] coding style update (perl_checker)

Thierry Vignaud thierry.vignaud at gmail.com
Sat Dec 10 20:37:35 CET 2011


On 10 December 2011 20:25, Romain d'Alverny <rdalverny at gmail.com> wrote:
>> just do sg like this:
>> [...]
>>    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 "()".

>>>  open(my $file, "temp_media_on_iso.log") if -r "temp_media_on_iso.log";
>>>
>>>  while ($media = <$file>) {
>>
>> just reuse cat_() from MDK::Common (simpler, easier to read)
>
> Thanks!
>
> 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

I've locally a branch adding doc for drakx but it's not finished.


More information about the Mageia-dev mailing list