$var=chr(0x0a).chr(0x0a).chr(0x0a).chr(0x01); # OR $var=v10.10.10.1; #using the v-string notation if your perl is new enough # OR $var=pack "CCCC", 10, 10, 10, 1; # OR (probably best yet) $var=inet_aton 0x0a0a0a01;