[EMAIL PROTECTED] schreef:
> use strict;
> use warnings;
>
> open (MYDATAS , " my @datas = ;
> close MYDATAS;
>
> foreach (@datas){
> s/^\s*$//;
> }
>
> open (WRITEDATAS, ">testing.txt") || die $!;
> print WRITEDATAS @datas;
> close WRITEDATAS;
That looks a lot like Perl 4. Study this:
#!/usr
On Sun, Apr 6, 2008 at 11:17 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>
> Your problem is that the line "123\n" does not match the pattern /^\s*$/.
> Try it using two substitutions like this:
>
> s/^\s+//;
>
> s/\s+$//;
or use one,
s/^\s+|\s+$//g;
--
To unsubscribe, e-mail: [EMAIL
[EMAIL PROTECTED] wrote:
Hi,
Hello,
The script below is suppose to erase off, from a file, all blank lines
including newlines, I wrote the regex is as follows : s/^\s*$//;
however after running the script, a last newline remains.
Can someone explain why the regexp can erase off all newlines
Hi,
The script below is suppose to erase off, from a file, all blank lines
including newlines, I wrote the regex is as follows : s/^\s*$//;
however after running the script, a last newline remains.
Can someone explain why the regexp can erase off all newlines in the file
except the last newlin