in reply to dereferencing problem

Briefly looking at your code, I would try removing all the \$ and $$ stuff and I think it will be a good start.

Use the return( $width, $height ); and get rid of the other one. Then in the main script you test like so.

if($height > 150 ) { # ... } elsif($width > 150) { # ... stuff here } # ... more stuff here

In this program you dont need any references just the regular values $var etc.

Update: You might also try scaling the images by the same percent instead of by the same numeric amount. Say its 200x100 then 150/200 is .75 so make the 100 dimension 75 (100*.75) instead of 50 (100-(200-150)) like the current code would.

Replies are listed 'Best First'.
Re: Re: dereferencing problem
by NereDoWell (Initiate) on Mar 14, 2003 at 23:04 UTC
    dga
    Many thanks;

    I got sidetracked to the dereferencing when I got the wrong values for height and width from the subroutine. After scrapping that and going back to using the vars directly I noticed that I was still sending the default image to the sub. There was no way the sub could return the values I was looking for. All is now well. I also took your advice and altered the resizing to a percentage.

    I would also like to say thank you here to bbfu and Mr. Muskrat for their help and advice.

    NereDoWell