Andy Dougherty wrote:
>
> > Perl should be able to distinguish between printable strings and
> > packed binary data stored as strings (presumed to not be printable
> > text)
>
> All strings are "printable" in perl, since print just calls fwrite(). I
> can and do use perl to "print" binary data. print $a is perfectly fine
> even if $a is a packed binary thing.
Under this RFA you'd either have to say C<print "$a"> or simply not invoke C<use
warnings 'packed'>.
> In fact, since there is no other way
> to call fwrite() [write does format things, and syswrite bypasses stdio,
> which may not be appropriate] print $a is probably the best way to output
> a packed binary thing.
If this is true, that this is a common usage, and explicitly stringifying with
C<""> seems unacceptable, DWIMishness would require backing off the warning on
this construct.
>
> > If anyone knows of common constructs/idioms which would break under
> > this scheme and where it's too painful to add C<pack("a*",...)> or
> > C<"..."> as appropriate ... well I don't have to ask to have them
> > pointed out, do I? :-) The only cases I've been able to think of are
> > JAPHs or code samples.
>
> "too painful" is, of course, a judgment call. I do use the
> read/unpack/modify/pack/print cycle a fair amount dealing with image data.
> I guess I'd say working around RFC 258 might be annoying but not painful.
AFAICT backing off on the warning applied to C<print $packed_thing> would remove
your only source of annoyance. I don't *think* I have a problem with doing that.
--
-- Tim Conrow [EMAIL PROTECTED] |