$string =~ s/^\s+//;

http://oreilly.com/catalog/9781565922433/ page 43

That book is my bible!!!

On Sun, Oct 31, 2010 at 11:01 AM, Brian <brian5432...@yahoo.co.uk> 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
>
>
>




-- 
Richard Hug
813-973-3783
cell 813-361-7946

Reply via email to