>Hello, >I would like to search content of file and as a pattern to use hash, but >I can't find out how to do that. > >Situation: >%hash = ( "key1" => "value1", > ... > "keyn" => "valuen"); >
Hello, Here it's easy to access the hash's value via its key,simply as: $hash{"key1"}; I think you would want to do this replacement: s/key1/$hash{key1}/; About perl's hash data structure,see 'perldoc perldata' please. -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>