yam has asked for the wisdom of the Perl Monks concerning the following question:
I get bupkis. it means nothing in Yiddish#!/usr/bin/perl -w open SSG, "<ADRX.ssg" || die "can\'t open ADRX.ssg"; @ssg = <SSG>; chomp @ssg; print $ssg[93];
If I remove the chomp(), the data are there in the array as it says on the box,[ceidem@bizet ~/src/perl/ssg]$ ./pssg2.pl [ceidem@bizet ~/src/perl/ssg]$
but then I've got the '\n'.#!/usr/bin/perl -w open SSG, "<ADRX.ssg" || die "can\'t open ADRX.ssg"; @ssg = <SSG>; #chomp @ssg; print $ssg[93];
If I use a foreach and a chomp, I get nothing. What gives? How can I remove the newline? Thank you in advance, - yam[ceidem@bizet ~/src/perl/ssg]$ ./pssg2.pl 2002 [ceidem@bizet ~/src/perl/ssg]$
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading a file into an array
by CountZero (Bishop) on Mar 11, 2004 at 23:02 UTC | |
|
Re: Reading a file into an array
by Happy-the-monk (Canon) on Mar 11, 2004 at 22:58 UTC | |
|
Re: Reading a file into an array
by matija (Priest) on Mar 11, 2004 at 22:55 UTC | |
|
Re: Reading a file into an array
by Anonymous Monk on Mar 12, 2004 at 03:59 UTC | |
|
Re: Reading a file into an array
by yam (Novice) on Mar 12, 2004 at 00:57 UTC |