Lines Matching full:line

64         while (my $line = <BLANK_OLD>) {
66 push @lines,$line;
67 if ($line =~ $pattern) {
74 while ( my $line = shift @lines ) {
75 &B_print(*BLANK_NEW,$line);
95 # immediately after $line_to_follow, if it exists. If said line does not
96 # exist, the line will not be inserted and this routine will return 0.
103 # You'd like to insert a line in Apache's configuration file, in a
121 # and the line we are supposed to be inserting after...
124 while (my $line=<INSERT_OLD>) {
125 push (@lines,$line);
126 if ($line =~ $pattern) {
129 if ( ($found_line_to_follow < 1) and ($line =~ $line_to_follow)) {
135 # Log an error if we never found the line we were to insert after
138 … &B_log("ERROR","Never found the line that we were supposed to insert after in $filename\n");
141 # Now print the file back out, inserting our line if we should...
144 while (my $line = shift @lines) {
145 &B_print(*INSERT_NEW,$line);
148 &B_log("ACTION","Inserted the following line in $filename:\n");
159 &B_log("ERROR","Couldn't insert line to $filename, since open failed.");
169 # immediately before $line_to_preceed, if it exists. If said line does not
170 # exist, the line will not be inserted and this routine will return 0.
177 # You'd like to insert a line in Apache's configuration file, in a
195 # and the line we are supposed to be inserting after...
198 while (my $line=<INSERT_OLD>) {
199 push (@lines,$line);
200 if ($line =~ $pattern) {
203 if ( ($found_line_to_preceed < 1) and ($line =~ $line_to_preceed)) {
209 # Log an error if we never found the line we were to preceed
212 … &B_log("ERROR","Never found the line that we were supposed to insert before in $filename\n");
215 # Now print the file back out, inserting our line if we should...
218 while (my $line = shift @lines) {
221 &B_log("ACTION","Inserted the following line in $filename:\n");
224 &B_print(*INSERT_NEW,$line);
233 &B_log("ERROR","Couldn't insert line to $filename, since open failed.");
263 # Additionally, if $pattern is set equal to "", the line is always appended.
270 # You'd like to add a root line to /etc/ftpusers if none exists.
271 # You'd like to add a Options Indexes line to Apache's config. file,
284 while (my $line=<APPEND_OLD>) {
285 &B_print(*APPEND_NEW,$line);
286 if ($line =~ $pattern) {
295 &B_log("ACTION","Appended the following line to $filename:\n");
302 &B_log("ERROR","# Couldn't append line to $filename, since open failed.");
320 # You'd like to insert the line "auth required pam_deny.so" to the top
334 while (my $line=<PREPEND_OLD>) {
335 push (@lines,$line);
336 if ($line =~ $pattern) {
343 while (my $line = shift @lines) {
344 &B_print(*PREPEND_NEW,$line);
350 &B_log("ACTION","Pre-pended the following line to $filename:\n");
355 &B_log("ERROR","Couldn't prepend line to $filename, since open failed.\n");
386 while (my $line=<REPLACE_OLD>) {
387 unless ($line =~ $pattern) {
388 &B_print(*REPLACE_NEW,$line);
391 # Don't replace the line if it's already there.
392 unless ($line eq $line_to_switch_in) {
396 &B_log("ACTION","File modification in $filename -- replaced line\n" .
397 "$line\n" .
403 &B_print(*REPLACE_NEW,$line);
411 &B_log("ERROR","Couldn't replace line(s) in $filename because open failed.\n");
419 # replacing the line matching the nth $pattern specified in $patterns_and_substitutes->[n]->[0]
454 while (my $line = <REPLACE_OLD>) {
456 my $switch_before = $line;
457 chomp($line);
463 my $evalstr = '$line' . "=~ s/$pattern/$replace/";
468 #if ( $line =~ s/$pair->[0]/$pair->[1]/) {
473 &B_print(*REPLACE_NEW,"$line\n");
476 B_log("ACTION","File modification in $filename -- replaced line\n" .
479 "$line\n");
487 &B_log("ERROR","Couldn't replace line(s) in $filename because open failed.\n");
515 while (my $line=<REPLACE_OLD>) {
516 unless ($line =~ $pattern) {
517 &B_print(*REPLACE_NEW,$line);
520 my $orig_line =$line;
521 $line =~ s/$pattern_to_remove/$text_to_switch_in/;
523 &B_print(*REPLACE_NEW,$line);
526 &B_log("ACTION","File modification in $filename -- replaced line\n" .
529 "$line\n\n");
536 &B_log("ERROR","Couldn't pattern-replace line(s) in $filename because open failed.\n");
560 # look at each line in the file
561 while (my $line = <FILE>) {
562 # if a line matches the pattern provided then
563 if($line =~ $pattern) {
579 # the provided pattern was not matched against a line in the file
607 while (my $line = <FILED>) {
608 if ($line =~ $pattern) {
655 # against the file specified on a line-agnostic form. This allows for
656 # patterns which by necessity must match against a multi-line pattern.
658 # provide multi-line capability not provided by B_replace_line.
678 foreach my $line ( @lines ) {
679 $big_long_line .= $line;
682 # Substitution routines get weird unless last line is terminated with \n
724 my $line;
725 while ($line=<HASH_OLD>) {
726 unless ( ($line =~ $pattern) and ($line !~ /^\s*\#/) ) {
727 &B_print(*HASH_NEW,$line);
730 &B_print(*HASH_NEW,"#$line");
731 &B_log("ACTION","File modification in $filename -- hash commented line\n" .
732 "$line\n" .
734 "#$line\n\n");
735 # while the line has a trailing \ then we should also comment out the line below
736 while($line =~ m/\\\n$/) {
737 if($line=<HASH_OLD>) {
738 &B_print(*HASH_NEW,"#$line");
739 &B_log("ACTION","File modification in $filename -- hash commented line\n" .
740 "$line\n" .
742 "#$line\n\n");
745 $line = "";
755 &B_log("ERROR","Couldn't hash-comment line(s) in $filename because open failed.\n");
782 my $line;
783 while ($line=<HASH_OLD>) {
784 unless ( ($line =~ $pattern) and ($line =~ /^\s*\#/) ) {
785 &B_print(*HASH_NEW,$line);
788 $line =~ /^\s*\#+(.*)$/;
789 $line = "$1\n";
791 &B_print(*HASH_NEW,"$line");
792 &B_log("ACTION","File modification in $filename -- hash uncommented line\n");
793 &B_log("ACTION",$line);
794 # while the line has a trailing \ then we should also uncomment out the line below
795 while($line =~ m/\\\n$/) {
796 if($line=<HASH_OLD>) {
797 $line =~ /^\s*\#+(.*)$/;
798 $line = "$1\n";
799 &B_print(*HASH_NEW,"$line");
800 … &B_log("ACTION","File modification in $filename -- hash uncommented line\n");
801 &B_log("ACTION","#$line");
803 &B_log("ACTION","$line");
806 $line = "";
815 &B_log("ERROR","Couldn't hash-uncomment line(s) in $filename because open failed.\n");
867 foreach my $line ( @lines ) {
868 $big_long_line .= $line;
871 # Substitution routines get weird unless last line is terminated with \n
975 foreach my $line (grep(/$inputRegex/,@lines)) {
976 $line =~ /$inputRegex/;
1034 while (my $line = <TODO>) {
1036 $line =~ s/(\\|\||\(|\)|\[|\]|\{|\}|\^|\$|\*|\+|\?|\.)//g;
1037 $multilineString .= $line;
1107 foreach my $line (@lines) {
1108 chomp($line);
1109 $GLOBAL_CONFIG{"$line"}{"TODOFlag"}="yes";