develooper Front page | perl.beginners | Postings from December 2002

hashes and string

Thread Next
From:
Simas Mockevicius
Date:
December 1, 2002 07:12
Subject:
hashes and string
Message ID:
1215.213.226.171.132.1038754454.squirrel@webmail.remo.lt
Hi,

I have falowing situation:

hash:
my $Hours = {
                '00' => '1',
                '01' => '1',
                '02' => '1',
                '03' => '1',
                '04' => '1',
                '05' => '1',
                '06' => '1',
                 ...
                '23' => '1', };

and a string:

my $hours_flags = "000000111111111111000000";

hou can I fill up my hash ($Hours) with the values I have in the string,
assuming that strings first symbol is a hash 00 key and so on? Any
thoghts? I realy need it, time is tiking away :(

Thanx,
Symka.

P.S. the string ($hour_flags) are taken from mysql database, so - always
not the same:-(



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About