[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    Re: reading in an array from a file
From:       Carl Jolley <cjolley () iac ! net>
Date:       2000-12-27 18:15:25
[Download RAW message or body]

On Wed, 27 Dec 2000, Curtis, Brad wrote:

> I am trying to populate an array with fields from a text file. My array
> is not being poplutated
> the delimination is ":" 
> 
> here is my code
> 
> use text::ParseWords;
> 
> open (test, "c:/appt.txt") || die "could not open";
> open (out, "c:/out.txt") || die "could not open out";
> while (test)
> { 
> (@fields) = split /"|"/;
> 
>  
> write @fields;
> 
> 
> }
> close (test);
> close (out);
> 

If your delimter is ':', why are you splitting on '|'?
And, as a curosity, what purpose/use is the 'out' file handle,
what is the module 'test' being used for, and what did
you expect to accomplish with the write function considering
that you apparently don't have a format specified? Oh, a
couple of other questions occur. Did you use the -w flag and
how may other perl programs (that work) have you written?

**** cjolley@iac.net <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic