Re: how to remove (^M ^G ) characters

2010-11-02 Thread John W. Krahn
Mike McClain wrote: Hi John, Thank you for your comments. Though I've been coding for many years I've never had a chance to work in a team environment and thus never had the benefit of code reviews. It's an education to see things from another viewpoint. On Sat, Oct 30, 2010 at 03:16:5

Re: how to remove (^M ^G ) characters

2010-11-01 Thread Mike McClain
Hi John, Thank you for your comments. Though I've been coding for many years I've never had a chance to work in a team environment and thus never had the benefit of code reviews. It's an education to see things from another viewpoint. On Sat, Oct 30, 2010 at 03:16:51PM -0700, John W. Krah

Re: how to remove (^M ^G ) characters

2010-10-30 Thread John W. Krahn
Mike McClain wrote: On Thu, Oct 28, 2010 at 07:28:19PM +0530, perl_haxor 123 wrote: characters and how can remove them using perl?.and also please let me if there is any link form where i can find what these characters are and their ascii values?..any sugges would be really helpful # m

Re: how to remove (^M ^G ) characters

2010-10-30 Thread Mike McClain
On Thu, Oct 28, 2010 at 07:28:19PM +0530, perl_haxor 123 wrote: > characters and how can remove them using perl?.and also please let me if > there is any link form where i can find what these characters are and their > ascii values?..any sugges would be really helpful # man ascii If that

Re: how to remove (^M ^G ) characters

2010-10-29 Thread John W. Krahn
Eitan Adler wrote: Did you know that Perl has built-in idioms to handle multiple file manipulation: #!/usr/bin/perl Small nitpick, but one that irks me very much: please keep this portable #!/usr/bin/env perl And you believe that to be portable? http://lists-archives.org/git/719934-perl-she

Re: how to remove (^M ^G ) characters

2010-10-29 Thread Eitan Adler
> Did you know that Perl has built-in idioms to handle multiple file > manipulation: > > #!/usr/bin/perl Small nitpick, but one that irks me very much: please keep this portable #!/usr/bin/env perl %ls -laod /usr/bin/perl ls: /usr/bin/perl: No such file or directory %ls -laod /usr/local/bin/perl

Re: how to remove (^M ^G ) characters

2010-10-28 Thread John W. Krahn
Brandon McCaig wrote: On Fri, Oct 29, 2010 at 12:57 AM, John W. Krahn wrote: If this is run on DOS/Windows then Perl will automatically translate "^J^M" to newline. On Windows, shouldn't "\cM\cJ" be equal to "\n"? :-/ I'm sorry for using "^J^M" above but in your unix2dos.pl program you us

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Brandon McCaig
On Fri, Oct 29, 2010 at 12:57 AM, John W. Krahn wrote: > That is usually written as: > > use File::Copy qw/ cp mv /; > > use takes a list after the module name. I thought it was up to the module to interpret the list and the documentation that I was reading online wasn't very clear so I played it

Re: how to remove (^M ^G ) characters

2010-10-28 Thread John W. Krahn
Brandon McCaig wrote: On Thu, Oct 28, 2010 at 9:28 PM, Jeff Peng wrote: You get the files from windows to un*x? try the command 'dos2unix'. ^G is a bell character (\a). That's not a platform issue, AFAIK. Anyway, in response to this thread I wrote Perl scripts that seem to work as replacement

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Brandon McCaig
On Thu, Oct 28, 2010 at 11:21 PM, Brandon McCaig wrote: >    cp $in_fn, "$backup" or die "Failed to backup '$in_fn': $!"; *snip* >    unlink "$backup" or Sigh. I [wrongly] quoted a variable. :P For the record, $backup started as "$in_fn.orig". After seeing myself use it more than once I decided t

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Brandon McCaig
On Thu, Oct 28, 2010 at 9:28 PM, Jeff Peng wrote: > You get the files from windows to un*x? > try the command 'dos2unix'. ^G is a bell character (\a). That's not a platform issue, AFAIK. Anyway, in response to this thread I wrote Perl scripts that seem to work as replacements for dos2unix and uni

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Jeff Peng
于 2010-10-28 21:58, perl_haxor 123 写道: Hi All, I'm a beginner in perl and i try to read a file, but these files contains characters like (^M ^G)..I wanted to know what are these characters and how can remove them using perl?.and also please let me if there is any link form wh

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Shlomi Fish
Hi perl_haxor, On Thursday 28 October 2010 15:58:19 perl_haxor 123 wrote: > Hi All, > >I'm a beginner in perl and i try to read a file, but these files > contains characters like (^M ^G)..I wanted to know what are these > characters and how can remove them using perl?.and also

how to remove (^M ^G ) characters

2010-10-28 Thread perl_haxor 123
Hi All, I'm a beginner in perl and i try to read a file, but these files contains characters like (^M ^G)..I wanted to know what are these characters and how can remove them using perl?.and also please let me if there is any link form where i can find what these characters are a