On Feb 25, Carlo Sayegh said:
> print "\nPlease state below your duties as $function
>adminstrator. Press <enter> then<^D> twice when done.\n\n";
>
>while (<>) {
> if ( (/^DONE/) ) {
> last;
> }
>}
>
>@data1 = <STDIN>;
>chomp (@data1);
Uh.... do you know what that while loop is doing? It's reading input
until it reaches a line that starts with "DONE". THEN you read content
into @data1. I think you should remove the while loop. (And the user
should only have to press ^D once.)
> print "\nPlease indicate any other duties performed.
>Press <enter> than <^D> twice when done.\n\n";
>
>while (<>) {
> if ( (/^DONE/) ) {
> last;
> }
>}
>
>@data2 = <STDIN>;
>chomp (@data2);
Ditto.
>open (LOGFILE, ">>/../../../../DRlogs/current");
> print LOGFILE "$day\ $username\ $function\ @data1\
>@data2\n";
>close LOGFILE;
What's with the backslashed spaces here? And why not check the return
value of open()?
open LOGFILE, ">> /path/to/current" or
die "can't append to /path/to/current: $!";
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]