However, i want to do this in a loop where $1 is already being used as something else, hence this doesn't work! Can anyone suggest an alternative?? Thanks!$string =~ s/(.{60})/$1\n/g;
if ($line =~ /^\s{0,3}(\w+)(\d+)(\w+)\s+((\w+))/) { # $1-$3 used by something else here my $string = $4; $string =~ s/(.{60})/$1\n/g; print "$string\n"; }
In reply to formatting strings by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |