Gossamer Forum
Home : General : Perl Programming :

characters

Quote Reply
characters
 
Is there a way to read the first to characters of a key in a hash for later procesing?

ex:

$scalar = first2char ($hash{'key'};
open (FILE, "$scalar.txt");

perlkid
Quote Reply
Re: characters In reply to
 
Ok, sorry guys,

I figured this one out two. If anyone wants to know what i did here it is;
Code:
$zip_where = "$in{'zipcode'}";
$what_zip_code = substr $zip_where, 0, 2;
$zip_code2 = "/c16/olbis/cgi-bin/zipcodes/$what_zip_code.txt";

perlkid