Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: dereferencing problem

by Desdinova (Friar)
on Mar 14, 2003 at 22:49 UTC ( [id://243198]=note: print w/replies, xml ) Need Help??


in reply to dereferencing problem

First the others are right there is no real reason to complcate this with references a simple copy by value is fine here, and there is no need to redo what has been done...

Now looking at the question I have to say that I grabbed your code and stripped to the most simple form and tested it. It doesn't have the derefeencing problem you mention
($width, $height) = gifdim('test_text'); print "Height = $$height Width = $$width \n"; exit; sub gifdim ($) { my $filename = $_[0]; my $height =200; my $width =300; return \($width, $height); }
output:Height = 200 Width = 300

So im not sure what problem you are having.

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

    Thanks for looking. I have stopped using the reference and I am now returning the vars by value. My true error was in failing to send the proper image to the subroutine. This obvously returned values that did not match the image I was maniplating. Since the original subroutine returned references I thought I might have introduced an error when I changed it. I tried using the references to check this and got sidetracked.

    Just why $$var gave me SCALAR(0xed880) instead of the value located at \$var I don't know but since the new structure works I'll come back to that issue later.

    Thanks and Thanks again to all
    NereDoWell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://243198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-28 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found