Ah, you're using an ancient perl. Simply leave out the use feature qw/say/; line, and replace say; in the loop body with a print statement:
while(<DATA>) { chomp; s/<([0-9A-F]+)>/hex($1)/eg; print "$_\n"; }
Actually, you could probably also get away with not chomping your input in the first place here:
while(<DATA>) { s/<([0-9A-F]+)>/hex($1)/eg; print; }
And at this point, assuming you merely want to output the results and do nothing further with them in this particular script, the whole script can be turned into a oneliner you can directly enter on the command line. Using perl's -p switch (see perlrun):
$ perl -pe 's/<([0-9A-F]+)>/hex($1)/eg' /home/stummala/a JDW-HP 1MVWV93V7j2Hxsa0Ag6 24:00:00 SUBJECT_EXACT _Did you160serve our +160country? -New VA Home.Loan Program_ JDW-HP 1MVWV98Ddd4fLsa0Ag6 24:00:00 SUBJECT_EXACT Did.you.serve_our co +untry? New-VA Home160Loan Program_ $
In reply to Re^5: How do i replace one variable with another after searching for a pattern
by AppleFritter
in thread How do i replace one variable with another after searching for a pattern
by Niklaus Mikaelson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |