On Thu, Aug 13, 2009 at 04:46:50PM +0200, Marek Stepanek wrote:
>
> And here a Perl-Filter to do it in one step. You select the text to
> change and you run the following filter over it (you save this snippet
> into your folder: ~/Library/Application Support/Unix Support/Unix
> Filters/):
>
> #!/usr/bin/perl
>
> while(<>) {
> s/(searchGetter\.)(\d+)/$1 . eval($2+6)/eg;
> print;
> }
>
You should not be calling eval there.
#!/usr/bin/perl
while (<>) {
s/(searchGetter\.)(\d+)/$1 . ($2+6)/ge;
print
}
(If you like, you can use -p for an implicit loop.)
#!/usr/bin/perl -p
s/(searchGetter\.)(\d+)/$1 . ($2+6)/ge;
Ronald
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or
confirmed) problem with the software, please email to "[email protected]"
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---