yeah, it's one of those that you shouldn't modify or you might start seeing
unexpected results. read perlvar or google 'perl input record separator' for
more.

On Mon, Nov 1, 2010 at 10:14 AM, Matthew Young <mab...@gmail.com> wrote:

> On Oct 31, 10:01 am, brian5432...@yahoo.co.uk (Brian) wrote:
> > Hi guys, long time no working with PERL :-)
> >
> > I have just installed 5.2.12
> >
> > First, I am trying to remove leading tabs & spaces but the following
> leaves a
> > few blanks at the beginning of each line, could someone be kind enough to
> point
> > out the error of my ways please? :-)
> >
> > #!/usr/bin/perl
> >
> > local $/=undef;
> > open(FILE, "smith3.txt") || die ("Error\n");
> > $string = <FILE>;
> > $string =~ s/\s//; #remove leading spaces
> >
> > print "$string";
> >
> > Secondly, I would like to remove newline from alternate lines, ie I would
> like
> > to remove from lines 1,3,5,7 etc.
> > What would be the simplest way of getting even line numbers to print on
> the same
> > line as odds?
> >
> > Thanks muchly
> > Brian
>
> Is $/ a special variable of some kind?
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to