die "...\n"; 

my $quantity = $line_item->{quantity}
    // die "quantity is not defined: ", Dumper($line_item);