{ local $/; $code = <>; } $code =~ s{ */\*.*?\*/ *}{ }gs; # allow "." to match "\n" # now split on commas (and newlines?)