in reply to De referencing

Your $align variable is actually a Bio::DB::Bam::Alignment object, so instead of stringifying it you have to call its methods and do something with their return values. You'll probably want to print $align->query->dna.