Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I need to preserve the entire "$_\n" and need it in a scalar as that is what is used throughout the program. I have also tried :while (<$file>) { push (@data, "$_\n"); } print @data;
with no success. thanks$data = do { local $/; $_ };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: slurping into scalars
by rob_au (Abbot) on Dec 16, 2002 at 10:07 UTC | |
by Anonymous Monk on Dec 16, 2002 at 10:17 UTC | |
by rob_au (Abbot) on Dec 16, 2002 at 10:22 UTC | |
by dingus (Friar) on Dec 16, 2002 at 11:11 UTC | |
|
Re: slurping into scalars
by thinker (Parson) on Dec 16, 2002 at 10:15 UTC | |
|
Re: slurping into scalars
by particle (Vicar) on Dec 16, 2002 at 18:53 UTC | |
|
Re: slurping into scalars
by Juerd (Abbot) on Dec 30, 2002 at 19:54 UTC |