use Modern::Perl; use Data::Dump qw /dump/; while () { chomp; my ($namedosageform, $instructions, $code) = grep {/\S/} split /<.*?>/; my ($name, $dosage, $form) = $namedosageform =~ /^([^\d]+)(\d+[^,]+),\s*(.*)$/; $code =~ s/mfg codes:(.*)/$1/; say "Name: $name\nDosage: $dosage\nForm: $form\nInstructions: $instructions\nMFG codes: $code\n"; } __DATA__

FENTANYL 25MCG/HR PATCH, TRANSDERMAL 72 HOURS

Restricted to NDC labeler code 50458 (Janssen) and to a maximum of ten (10) transdermal patches per dispensing and a maximum of three (3) dispensings of any strength in a 75-day period only.

mfg codes:50458

DURAGESIC

ACETAMINOPHEN 80MG/0.8ML SUSPENSION, DROPS(FINAL DOSAGE FORM)(ML)

Restricted to individuals younger than 21 years of age for the liquid and drops only.

mfg codes:68016, 63868, 63162, 49348, 46122, 36800, 00904, 00536, 00472, 00113, 00067

TRIAMINIC FEVER REDUCER | PAIN & FEVER | NORTEMP | MAPAP INFANT | INFANTS' NON-ASPIRIN | INFANT'S PAIN RELIEVER | INFANT'S PAIN RELIEF | INFANT'S NON-ASPIRIN | ACETAMINOPHEN