solved the first problem:

while (@ary = $sth->fetchrow_array()){
                
                if ($ary[0] =~ /\//) {
                                        @parts = split /\s/, $ary[0];
                open FILE, "> c:\/\/output\/$ary[1]\/$parts[0]$ending\n";
                                        }
                else {open FILE, "> c:\/\/output\/$ary[1]\/$ary[0]$ending\n";}
# open FILE,


print FILE "\<html\>\n\<p\>\n$ary[0], $ary[1]\n\<\/p\>\n\<\/html\>";
close FILE;


On 15/10/2007, Brad Cahoon <[EMAIL PROTECTED]> wrote:
> HI
>
> I keep getting errors saying:
>
> Use of uninitialized value in concatenation (.) or string at
> pagecreate.pl line 25.
> print() on closed filehandle FILE at pagecreate.pl line 29.
>
> i have a script which calls a database and there are values in $ary[0] like:
>
> bob smith
> joe
> susan / john
> larry jones / cary grant
>
> and $ary[1] like:
>
> friends
> enemys
> not sure
>
> I am trying to put the details into directory/pages and have fallen
> down at the following code also i will try to put in underscores for
> names and directories once this bit works:
>
>
> while (@ary = $sth->fetchrow_array()){
> open FILE, ">c:\/\/output\/$ary[1]\/(
>                 if ($ary[0] =~ m/\//) {($var1, $var2, $var3) = (split(/\s/,
> $ary[0]))$var1$ending}
>                 else {$ary[0]$ending}";
>
> print FILE "\<html\>\n\<p\>\n$ary[0], $ary[1]\n\<\/p\>\n\<\/html\>";
> close FILE;
>
>
> print "$ary[0] webpage written\n";
>
>
> in testing i hashed out FILE commands and just tried to print to STDIN
>
> print ">c:\/\/output\/$ary[1]\/(
>                 if ($ary[0] =~ m/\//) {($var1, $var2, $var3) = (split(/\s/,
> $ary[0]))$var1$ending}
>                 else {$ary[0]$ending}";
>
> i could see the values coming from the database in between the errors
> but the regexp don't work.
>
> Thanks
> Brad
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to