replace char n times

2001-12-03 Thread Mark Hanson
Hi gurus! I want to use the quantifier {COUNT}? in the following program to remove the first three underscores. I'm trying to avoid a loop. I have not been able to figure out the syntax. $a = "The_quick_brown_fox_jumped_over_the_lazy_dog."; $count = "3"; $a =~ s/(_{$count}?)//; print "\n$a\n

add hash to hash of hash

2001-12-03 Thread Mark Hanson
Hi, Still more hash questions: using the example in chapter 9 of Programming Perl: %HoH = ( flintstones => { husband=>"fred", pal=>"barney", }, ); how can dynamically add another hash to %HoH? In Programming Perl, they have a hard coded example

permanently modify a hash key?

2001-12-03 Thread Mark Hanson
Hi! Yet another hash question: How can I permanently modify a hash key? I have the following hash: my %hash = ( hygiene_products_total_amount => { 'conditioner' => "5", 'shampoo' => "57", 'soap' => "1",

Urgent! creating new hash from hash based on format of another hash

2001-12-02 Thread Mark Hanson
Hi gurus! I'm need to create a new hash dynamically using an existing hashs data in the format of another hash for comparison purposes. Here are my two hashes: %newhash = ( hygiene_products => { quantity_3 => "50",