first value is /home/bob/2.scripts/pages/3.cw/template_stuff/aimages
Use of uninitialized value in concatenation (.) or string at template_
+stuff/html7.pm line 127, <STDIN> line 2.
array part is
undefined!...initializing:
a is /home/bob/2.scripts/pages/3.cw/template_stuff/aimages/quux
b is quux
AoA put failed
first value is /home/bob/2.scripts/pages/3.cw/template_stuff/aimages
Use of uninitialized value in concatenation (.) or string at template_
+stuff/html7.pm line 127, <STDIN> line 2.
array part is
undefined!...initializing:
a is /home/bob/2.scripts/pages/3.cw/template_stuff/aimages/quux
b is quux
AoA put failed
return is 3.cw15.html
$
The offenders are create_page and put_page, who until recently, were part of main. Relegating them to be subroutines was great for legibility in main, but I seem to have developed issues. First of all, even though it tells me it fails every time, it gets a page on the net. The resulting page is weirdly-populated. ugly page
My main data struture is a hash that I pass into all my subroutines:
my $rvars = shift;
my %vars = %$rvars;
But then I want to create something with persistence, like:
$vars{refc} = get_content($rvars);
$rvars = \%vars; ## will same trick work?
and then
print "Put file to server(y/n)?: ";
my $prompt2 = <STDIN>;
chomp $prompt2;
if ( $prompt2 eq ( "y" | "Y" ) ) {
put_page( $sftp, $rvars );
}
$ref_content's value is NULL, so this is not an effective pass.
my $ref_content = $vars{refc};
my @AoA = @$ref_content;
say "content----------";
print Dumper $ref_content;
for my $i ( 0 .. $#AoA ) {
say "first value is $vars{to_images} ";
say "array part is $AoA[$i][0]";
if (!defined $AoA[$i][0]) {
say "undefined!...initializing:";
$AoA[$i][0] = 'quux';
}
my $a = path( $vars{to_images}, $AoA[$i][0] );
say "a is $a";
my $b = $a->basename;
say "b is $b";
$sftp->put( $a, $b ) or warn "AoA put failed $@\n";
}
It didn't always used to be this broken, so I'm happy to entertain suggestions.... |