>>>>> "JP" == Jeff Pang <pa...@arcor.de> writes:

  JP> 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;
  >> 

  JP> That would be a hash slice:

  JP> 
@hash{$filename,$file_start,$file_time,$video_track,$audio_track,$quality,$sync}
  JP> = ();

i don't see the OP asking for a slice. in fact i don't understand what
he is actually asking for.

OP: that code is legal but overwrites each value in the hash with the
next one as the $key stays the same. try to restate your question or
better yet, backup and explain what your goal is and not ask how to code
it.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

--
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