Antec1981 has asked for the wisdom of the Perl Monks concerning the following question:
This has worked fine for me in the past... as 57 bytes iswhile(read(filehandle,$buf,60*57){ $unf .=encode_base64($buf); }
I have run this 2 way one way i just looked at the print#!/usr/bin/perl use MIME::Base64; $imgpath = "/home/freexxxm/public_htmlews_photos"; # Ed. - rot13ed to make firewall safe $cat="Nany-Frk"; open (LOG, ">> log2"); opendir (DM, "/home/usr/public_htmlews_photos") or print "$today <b>E +RROR</b> couldn't get contents of <br>dir $!\n" ;<br> @files=grep { /\.jpg/ } readdir(DM); closedir(DM); $img=$files[rand(@files)]; while ($seen){$img++}; $img; print "$img $!\n"; open(FILE, "$imgpath/099.jpg") or print LOG "$today <b>ERROR</b> openi +ng image while posting $!\n";<br> while (read(FILE, $buf, 60*57)) { print LOG"$buf$!"; $unf .=encode_base64($buf); } print "$unf"; close FILE; close LOG;
update (broquaint): added formatting and rot13ed the contents of $cat for naive firewalls
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: UFT-8 Error
by graff (Chancellor) on Jul 04, 2003 at 04:10 UTC | |
|
Re: UFT-8 Error
by xdg (Monsignor) on Jul 04, 2003 at 11:45 UTC |