2010/7/24 Mike Martin <redt...@gmail.com>:
> Is this possible?
>
> I am trying to populate a hash with keys as variable name and value as
> variable value eg:
> my %hash;
> foreach my $w 
> ($filename,$file_start,$file_time,$video_track,$audio_track,$quality,$sync){
> my $hash{$key}=  $w;
>

That would be a hash slice:

@hash{$filename,$file_start,$file_time,$video_track,$audio_track,$quality,$sync}
= ();
see perldoc perldata:
http://perldoc.perl.org/perldata.html


-- 
Jeff Pang
http://home.arcor.de/pangj/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to