現在、mysqlからの選択から作成されたjsonがあり、次のようになっています。
$sth->execute()
  or die "SQL Error: $DBI::errstr\n";
while (my $row = $sth->fetchrow_hashref ){
    push @output, $row;
    # print $row->{image};
    $photo = $row->{image};
    my $file = "$photo";
    my $document = do {
        local $/ = undef;
        open my $fh, "<", $file
          or die "could not open $file: $!";
        <$fh>;
    };
    my $encoded= MIME::Base64::encode_base64($document);
}
JSON は次のようになります。
{"myData":[{"favorited":null,"date":"2013-07-31","preferredMeetingLocation":"meet here","description":"Clothes desc","image":"/var/www/pictures/photo-7h1sIsXQ.jpg","id":"31","title":"clothing ","price":"12","category":"Clothing","isbn":null}]}
そして、私がやりたいのは、json文字列の各オブジェクトの実際の画像に変更したい画像へのファイルパスを示す場所の代わりです。最終的には、各画像をbase64にエンコードしたいのですが、その部分を行う方法を知っています。/var/www/pictures/photo-7h1sIsXQ.jpgこの場合、作業してエンコードできるものに変更するのに助けが必要です。