Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
now what i would like to do is put the contents of @data in to a 1 line string so thatmy @data; open(FILE, "<$filename"); foreach(<FILE>){ push @data,$_ unless ($_ eq "\n"); } close FILE;
becomesxxxxxxx xxxxxxxx xxxxxxxxx xxxxxx
ive tried and tried but just cant do it :/xxxxxxx xxxxxxxx xxxxxxxxx xxxxxx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: read file into 1 line string
by davido (Cardinal) on Apr 21, 2012 at 15:31 UTC | |
|
Re: read file into 1 line string
by hperange (Beadle) on Apr 21, 2012 at 12:47 UTC | |
|
Re: read file into 1 line string
by stevieb (Canon) on Apr 21, 2012 at 13:22 UTC | |
by jwkrahn (Abbot) on Apr 22, 2012 at 03:48 UTC | |
|
Re: read file into 1 line string
by tommyxd (Acolyte) on Apr 21, 2012 at 12:13 UTC | |
|
Re: read file into 1 line string
by trizen (Hermit) on Apr 21, 2012 at 14:24 UTC | |
by hperange (Beadle) on Apr 21, 2012 at 14:48 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |