develooper Front page | perl.beginners | Postings from March 2002

interesting question about variables

Thread Next
From:
maasha
Date:
March 15, 2002 01:30
Subject:
interesting question about variables
Message ID:
20020315093045.GA1065@image
hi

i have a loop containing the following block of code. however, first time the loop is run, $text_link is empty, which it shouldn't be. i cant move the declaration of $text_link above the if statment, because then the $figure_name would be empty.

now i guess im really missing out on something fundamental here, since i cant figure out how this issue is solved!

any suggestions will be appreciated

:o)

martin

     
if ( ( $hash -> { $paragraph } ) =~ s/###(\w+.*\.jpg)###/($text_link)/ ) {
  $figure_name = $1;

  $text_link = $cgi -> a({-href => "javascript: window.open('$pix_dir/$figure_name'," 
                                 . " '', "
                                 . " 'status=yes, "
                                 . "  resizable=yes, "
                                 . "  scrollbars=no, "
                                 . "  width=530,"
                                 . "  height=380'"
                                 . ");
                                   void('');"
                           }, "Fig $figure_number" );
  			  
  $figure_number++;
}

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About