Re: Yet another Perl headache
by "Shaun L. Sides" <arch(at)charter.net>
|
| Date: |
Wed, 12 Jul 2000 04:28:03 -0400 |
| To: |
hwg-languages(at)hwg.org |
| In-Reply-To: |
hwg |
| |
todo: View
Thread,
Original
|
|
-----BEGIN PGP SIGNED MESSAGE-----
On 11 Jul 2000, at 1:31, benmaynard(at)connectfree.co.uk wrote:
> sub format_stuff {
>
> open(CF, "< card.data") || die "Died: $!";
> $ident=<CF>;
> close(CF);
Here you should be slurping everything into an array. You're only
going to get the first line from the file, because you use a scalar.
Do @ident = <CF>; here. Be aware that the program could use a
lot of memory if card.data is a big file.
Next you'll want a looping construct if you wish to do something
with each of the elements of the array you just made.
for each @ident {}
> $ident++;
> $iden = "$ident";
> $site = "http://www.voodoox.net/user/bmaynard/cgi-bin/view_card.cgi?
> ident=$ident";
Then, you're trying to assign something to a constant here on this
last line. That won't work. ;-) A constant can never go on the left
side of an assignment statement.
That's a quick analysis, but it should nudge you in the right
direction.
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.2 -- QDPGP 2.61a
Comment: http://community.wow.net/grt/qdpgp.html
iQCVAwUBOWwsEiEw9uEAOtM/AQF0SgP9Gec4+dm7ksmGt4i1SFkCJB6V8y0FAtx6
vF39IdCw9kfqmDSqhDEzjmOreriDKbdRNvJF/9JEUcbE6fDtKOCHWWthQYA+Eoef
GY9Efz1yE7pLVxkF/8bbVYJFCpcYtZmOeQXuCDt+ohIrvUS8N4ngbEohufUvDeQC
bSYNDhxL4U0=
=znWn
-----END PGP SIGNATURE-----
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.