Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't modify single ref constructor in scalar assignment

Status
Not open for further replies.

calabama

Programmer
Feb 19, 2001
180
US
Does anyone know where I could locate ActivePerl Diagnostic and ErrorMessage documentation.

I'd like to locate a means to a solution for this error.



I have only found one(1) reasonable thread related to this topic:

when searching the internet for this error:
Can't modify single ref constructor in scalar assignment at
C:\WINDOWS\TEMP\DzTemp.pl line 5, near ""data";"

resulting from the folowing line of perl code:
\$data_dir = "data"; # data directory like "data"


Any line of code which includes an escape character before a $variableresults in the same error followed with:
Execution of C:\WINDOWS\TEMP\DzTemp.pl aborted due to compilation errors

I am Using:

ActivePerl /Build 623
DZSOFT Editor 4.0
Windows 98
 
"\$data_dir" is the address of "$data_dir", i.e.
"SCALAR(0xf00a89fc)" , and it doesn't take well to being told to reassign itself to "data". if you want $data_dir to be a reference to a string, try:[tt]
my $tmp = "data"
$data_dir = \$tmp;[/tt]

then to print out what $data_dir refers to:[tt]
print $$data_dir;[/tt]

however, scalar references aren't really needed in perl, as a reference itself is stored as a scalar, so you might as well just have the value there and skip the extra step. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top