--- Francis Henry <[EMAIL PROTECTED]> wrote:
> Craig,
>
> I'm a newbie too, but isn't the function "chomp"?
chomp is the one Craig seems to need, but there's also a chop.
chop() alsways knock a character off; chomp only pops input record
seperators (like newline, or CRLF, depending on what the
TED],
[EMAIL PROTECTED]
i.org> Subject: Re: Strange chop behaviour
Lightning flashed, thunder crashed and "Craig Moynes/Markham/IBM" <[EMAIL PROTECTED]
bm.com> whispered:
| open ( ERR, ";
You are mixing things here you don't want to mix. This should just be:
while ($in = ) {
You *can* mix these, but there is no real reason to. Especially not in
your sample c
Lightning flashed, thunder crashed and "Collin Rogowski" <[EMAIL PROTECTED]> w
hispered:
| They exist both.
| chop removes the last character.
| chomp removes the last character if it's newline.
Let's get this straight and correct. chomp removes the input record
separator ($/). This may or may
They exist both.
chop removes the last character.
chomp removes the last character if it's newline.
To the original problem:
I had a similar problem once.
Maybe your file has DOS-Newlines which are to characters (\r\n).
If you chop, you keep \r at the end which could mess around with
printing it
chomp removes only the newline (what you want I think) and chop removes the last
character
#instead of
chop $in;
#Try:
chomp $in;
Greg
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Craig,
I'm a newbie too, but isn't the function "chomp"?
Francis
Craig Moynes/Markham/IBM wrote:
> A little background. I am running an scp process within a perl script and
> redirecting the error to a file (scp_err). I then read in the lines of
> this file and attempt to place them in an e
A little background. I am running an scp process within a perl script and
redirecting the error to a file (scp_err). I then read in the lines of
this file and attempt to place them in an error string to log to syslog.
Code Sample:
#!/usr/bin/perl -w
open ( ERR, ";
chop $in;
pr