Question
I am trying to print line above the the regex in below program in if statement in the file. I am using $` but it does not display any output. I checked my syntax which is correct. Please assist
#!/usr/bin/perl use strict; open(ORA, "/usr/cle_un"); while(<ORA>){ print "test: $`\n" if /^Func_file_permission$/; } close(ORA);
File details
ram: 702 Func: Func_file_permission testing tam: 768 Func: Func_file_permission test cham: 803 Func: Func_file_permission test
I want my results to show:
ram: 702 tam: 768 cham:803
In reply to filehandle regex by pinnacle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |