Yes it does work if I hard code the variables.
The code to get $height and $width is:
sub getfilesize{
my @spec=();
open FH, $file;
for (0..9){$spec[$_] = getc(FH);}
close FH;
my $tmp1 = unpack("H2",$spec[7]).unpack("H2",$spec[6]);
my $tmp2 = unpack("H2",$spec[9]).unpack("H2",$spec[8]);
$width = unpack('s',pack('s',hex($tmp2)));
$height = unpack('s',pack('s',hex($tmp1)));
}
I know it's a bit screwy, but I just need to get the filesize out of a gif, no other format, so I thought writing the quick bit would be easier than plugging in a whole module.
Given that, can you tell me why it's tainted? I'm lost on that one.
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.