Home > Archive > PERL Beginners > July 2006 > printing character "/"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
printing character "/"
|
|
| JJLaRocque@gmail.com 2006-07-26, 6:57 pm |
| Hi all, is there any way to add a "/" onto the end of a string or in
between two strings in a print statement? When I try to print the
string "$string1 /$string2", where $string1 and $string2 are variables,
the slash is brought to the beginning of the line, and string2 is added
at the beginning of the line, overwriting $string1.
I've been trying google searches for about 45 minutes and am really
frustrated, please help me out! I know this must have a ridiculously
simple solution...
| |
| Paul Lalli 2006-07-26, 6:57 pm |
| JJLaRoc...@gmail.com wrote:
> Hi all, is there any way to add a "/" onto the end of a string or in
> between two strings in a print statement? When I try to print the
> string "$string1 /$string2", where $string1 and $string2 are variables,
> the slash is brought to the beginning of the line, and string2 is added
> at the beginning of the line, overwriting $string1.
You have completely misdiagnosed your problem. My guess is that you
have windows-style newlines (ie, including a carriage return) on your
data.
Try running `dos2unix` on your datafile before continuing.
> I've been trying google searches for about 45 minutes and am really
> frustrated, please help me out! I know this must have a ridiculously
> simple solution...
Next time, please post a short-but-complete script that demonstrates
your error. As it is, what I guessed above is just that - a guess.
Paul Lalli
| |
| JJLaRocque@gmail.com 2006-07-27, 6:57 pm |
| Wow... good guess. Thanks a lot for your help, you were right, one of
my variables was read from a windows-generated file.
Is there any way to tell if a file has windows-type newlines or other
special characters?
Paul Lalli wrote:
> JJLaRoc...@gmail.com wrote:
>
> You have completely misdiagnosed your problem. My guess is that you
> have windows-style newlines (ie, including a carriage return) on your
> data.
>
> Try running `dos2unix` on your datafile before continuing.
>
>
> Next time, please post a short-but-complete script that demonstrates
> your error. As it is, what I guessed above is just that - a guess.
>
> Paul Lalli
|
|
|
|
|