in reply to Re: Re: pushing
in thread pushing

OK. Next guess would be that you're not checking the results of the GB open call (which you haven't shown us) and that therefore your @gb array ends up empty.

What gets written to the error log? Have you tried running the script from the command line?

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

Replies are listed 'Best First'.
Re: Re: Re: Re: pushing
by pawel_guz (Novice) on Dec 30, 2000 at 18:50 UTC
    this is my whole section in trouble:
    open (GB, ">>guestlog2.htm") or die "cant open data file: $!\n"; flock(GB, 2) or die "can't LOCK_EX data file: $!"; @gb = <GB>; @gb2 = ("dgfdhgfdhgfdh"); foreach $line (@gb) { push (@gb2,$line); if($line =~ /INSERT_NEW_ENTRY/g){ push (@gb2,"<b>Name:</b> $FORM{'Name'}\r<p>\r<b>Date:</b> <i>E +RROR! Notify Me!</i>\r<p>\r<b>E-mail Address:</b> <a href=\"$FORM{'em +ailaddress'}\">$FORM{'emailaddress'}</a>\r<p>\r<b>Comments:</b> $FORM +{'Comments'}\r<hr>\r"); } } seek (GB, 0, 0) or die "can't rewind $data_file: $!"; truncate(GB,0); print GB @gb2; close (GB) or die "can't close data file: $!";

      You're opening the file for writing, but trying to read from it. Therefore your @gb array gets no data when you do:

      @gb = <GB>;

      Try opening the file for reading (or read/write) and see if it makes a difference.

      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me

      In this line, if($line =~ /INSERT_NEW_ENTRY/g){ there is no need for the "g".

      --
      $you = new YOU;
      honk() if $you->love(perl)