sfantar wrote:
> John W. Krahn a écrit :
>>
>> #!/usr/local/bin/perl
>> use strict;
>> use warnings;
>>
>> my @authors;
>> my @titles;
>>
>>
>> for my $file ( @ARGV ) {
>>     $file =~ tr/ /_/;
>>
>>     my ( $author, $title ) = split /-/, $file;
>>
>>     push @authors, $author;
>>     push @titles, $title;
>>     }
>>
>> __END__
> 
> Thank for your explanation.
> Can I use a hash array to do what I wanted initially that is to say if I
>  choose an author then I get his songs ?
> 
> For instance : Freda Payne -> first_song.mp3
> 
>                -> second_song.mp3
> 
> The name of the author must be the value and not the key because we
> can't have two equal keys. Is that right?

Yes, hash keys are unique so you probably want to use a Hash of Arrays.

perldoc perldsc
perldoc perllol



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to