Re: How to replace a "/" in perl

chunj... [at] gmail.com wrote in news:1172009738.829363.189370
[at] v45g2000cwv.googlegroups.com:


> I have a list of sql files, in which it ends with a "/". Now I want to
> replace it with "//end" for all files. And here is my perl command,
> "
> perl -pi.org -e 's/^\/$/^\/\/end$/' *.SQL
> "

> Suprisingly it does not work.



It does not work is a bad description. Please read the posting
guidelines for this group.

#!/usr/bin/perl


use strict;
use warnings;


while ( <DATA> ) {
s{^/$}{//end} and print;



}


__DATA__
/
/
jchen750021 [ Fr, 16 März 2007 03:40 ] [ ID #1660085 ]
Perl » comp.lang.perl.modules » Re: How to replace a "/" in perl

Vorheriges Thema: fork process help needed
Nächstes Thema: RE: What is abriviationfor CHR(4)