Results 1 to 3 of 3

Thread: Speed up Perl Code???

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Speed up Perl Code???

    what would be a faster way to do all of this? (switches out the text $var for what is inside the variable)

    $html =~ s!\$vehicle_make!$vehicle_make!;
    $html =~ s!\$vehicle_state!$vehicle_state!;
    $html =~ s!\$vehicle_model!$vehicle_model!;
    $html =~ s!\$vehicle_year!$vehicle_year!;
    $html =~ s!\$vehicle_vin!$vehicle_vin!;
    $html =~ s!\$vehicle_body_type!$vehicle_body_type!;

    $html =~ s!\$location_name!$location_name!;
    $html =~ s!\$vehicle_owner_name!$vehicle_owner_name!;
    $html =~ s!\$vehicle_address!$vehicle_address!;
    $html =~ s!\$location_address!$location_address!;
    $html =~ s!\$contact_name!$contact_name!;
    $html =~ s!\$contact_address!$contact_address!;
    $html =~ s!\$vehicle_plate_number!$vehicle_plate_number!;

    $html =~ s!\$policy_type!$policy_type!;
    $html =~ s!\$vehicle_bodyinj_person!$vehicle_bodyinj_person!;
    $html =~ s!\$vehicle_bodyinj_acc!$vehicle_bodyinj_acc!;

    $html =~ s!\$producer_code!$producer_code!;
    $html =~ s!\$effective_date!$effective_date!;
    $html =~ s!\$expiration_date!$expiration_date!;
    $html =~ s!\$line_of_bus!$line_of_bus!;
    $html =~ s!\$policy_insco!$policy_insco!;

    $html =~ s!\$producer_phone!$producer_phone!;
    $html =~ s!\$producer_fax!$producer_fax!;

    $html =~ s!\$underwriter_off!$underwriter_off!;#todo
    $html =~ s!\$underwriter!$underwriter!; #todo

    $html =~ s!\$ssn!$ssn!;
    $html =~ s!\$masternum!$masternum!;
    $html =~ s!\$address!$address!;
    $html =~ s!\$custidno!$custidno!;
    $html =~ s!\$driver!$driver!;
    $html =~ s!\$full_name!$full_name!;
    $html =~ s!\$fax!$fax!;
    $html =~ s!\$phone!$phone!;
    $html =~ s!\$wphone!$wphone!;
    $html =~ s!\$fphone!$fphone!;
    $html =~ s!\$cphone!$cphone!;
    $html =~ s!\$producer!$producer!;
    $html =~ s!\$date!$date!;
    #$html =~ s!\$policyno!$policyno!;
    $html =~ s!\$vid!$vid!;
    $html =~ s!\$id!$id!;
    $html =~ s!\$login!$login!;
    $html =~ s!\$key!$key!;
    $html =~ s!\$vehicles!$vehicles!;
    $html =~ s!\$drivers!$drivers!;
    $html =~ s!\$addnew!$addnew!;
    $html =~ s!\$binderno!$binderno!;

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    is there a way to do all of that in one regex?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    anyone???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width