Re: How to replace a "/" in perl

Re: How to replace a "/" in perl

am 16.03.2007 03:40:29 von jchen750021

chunj...@gmail.com wrote in news:1172009738.829363.189370
@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 ( ) {
s{^/$}{//end} and print;



}


__DATA__
/
/