in reply to pushing

Could it be that instead of

foreach $line (@bg) {

you actually meant

foreach $line (@gb) {

Using use strict and -w is a far quicker way of finding these sorts of errors than posting here.

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

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

Replies are listed 'Best First'.
Re: Re: pushing
by pawel_guz (Novice) on Dec 30, 2000 at 18:38 UTC
    No that was a typing error in the submission and it is @gb in the actual script. It is something else

      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

        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: $!";