use strict;
my $str = 'public Guid DellUploadItemID { get; set; }
public Guid UploadID { get; set; }
public string DellPurchaseID { get; set; }
public string PoNum { get; set; }
public string OrderNum { get; set; }
public string OrderType { get; set; }
public string InvoiceNum { get; set; }
public string PaymentDescription { get; set; }
public DateTime? OrderDate { get; set; }
public DateTime? ShippedDate { get; set; }
public DateTime? InvoiceDate { get; set; }
public decimal ReportLineTotal { get; set; }
public string ServiceTag { get; set; }
public string Category { get; set; }
public string SubCategory { get; set; }
public string Item { get; set; }
public string ItemLongName { get; set; }
public DateTime? WarrantyEndDate { get; set; }
public string ShipFirstName { get; set; }
public string ShipLastName { get; set; }
public string ShipToCompany { get; set; }
public string ShipAddress1 { get; set; }
public string ShipAddress2 { get; set; }
public string ShipCity { get; set; }
public string ShipState { get; set; }
public string ShipZip { get; set; }
public string ShipMethod { get; set; }
public string CarrierName { get; set; }
public string WaybillNumber { get; set; }
public string ExpressServiceCode { get; set; }
public string MACAddress { get; set; }
public string MACAddress2 { get; set; }';
my $regex = qr/(\w+\s+)(\w+\?*\s+)(\w+)\s+(\{.+\})/mip;
my $subst = '\\3 = d.\\3,';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html