I have a task that sounds this: You have real and natural numbers in .txt file and you have to put every element in between <> brackets. Can anyone help me?
use strict; use warnings; open my $FILE, '<', 'numbers.txt' or die "Cannot open numbers.txt:$!"; #######while (<$FILE>) { while ( my $string = <$FILE> ) { $string =~ s/([-+.\d]+)/<$1>/g; print "$string\n"; }