> > I'm trying to write a script that reads a file line by line  and if the
line
> > contains a space it puts quotation marks around it and writes it to
another
> > file.  I mostly have this working except that in the case of the lines
that
> > contain the space it puts the quotation mark at the beginning of the
next
> > line.  My guess is that
> >  print OUTFILE ($line);
> > also feeds a CR.  Is there a way around this?

> while (<INFILE>) {
>       chomp;
>       if (/ /) {
>               print OUTFILE "\"$line\"\n";
>       }
>       else {
>               print OUTFILE $line, "\n";
>       }
> }
>
> Give that a shot!
> Luke

except that you've mixed your metaphors, using chomp on the default $_, but
still printing $line.

                                /\/\ark


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to