use Devel::Peek; my $s = "30.31.force.0.5.1LGY.pdb"; Dump $s; print 0+$s, "\n"; # treat as number Dump $s; __END__ SV = PV(0x605150) at 0x604fa0 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x6370d0 "30.31.force.0.5.1LGY.pdb"\0 CUR = 24 LEN = 32 30.31 SV = PVNV(0x607880) at 0x604fa0 REFCNT = 1 FLAGS = (PADBUSY,PADMY,NOK,POK,pIOK,pNOK,pPOK) IV = 30 <--- NV = 30.31 <--- PV = 0x6370d0 "30.31.force.0.5.1LGY.pdb"\0 CUR = 24 LEN = 32