Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to do two different substitution for the same variable using perl?How can i perform it ?.In the below code i had done it separately .How can i make it still simple using perl?

What I have tried:

open my $IN, '<', $data_file or die $!;
while (my $line = <$IN>) {
    chomp $line;
    #$line=~ s/COMMENT//g;
    $line=~ s/[\\\_\@\_]//g;
    $line=~s/COMMENT//g;
Posted
Updated 23-Feb-17 0:53am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900