Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: can i concatenate various value to form a unique key

by missingthepoint (Friar)
on Jul 03, 2009 at 06:41 UTC ( [id://776953]=note: print w/replies, xml ) Need Help??


in reply to can i concatenate various value to form a unique key

so can i concatinate the values to get a unique key?

Maybe. Consider this:

$value1 = "a"; $value2 = "b"; $value3 = "c"; $value4 = "de"; $value5 = "f"; my $key = join("", $value1,$value2,$value3,$value4,$value5); print $key; $value3 = "cd"; $value4 = "e"; $key = join("", $value1,$value2,$value3,$value4,$value5); print $key;

So if you need different keys in situations like above, no. Perhaps you could generate a string that encodes the structure of the separate values, e.g.:

my $str = "v1=$value1,v2=$value2,v3=$value3,v4=$value4,v5=$value5"; # use $str for key, or perhaps generate hash of $str and use that

Ca3n w2e ple6ase st4op doi5ng th4is?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://776953]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-18 02:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found