Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Can't modify single ref constructor in scalar assignment

Can't modify single ref constructor in scalar assignment

Can't modify single ref constructor in scalar assignment

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:http://mailarchive.activestate.com/mail/msg/perl5-porters:468392

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

RE: Can't modify single ref constructor in scalar assignment

"\$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:
my $tmp = "data"
$data_dir = \$tmp;

then to print out what $data_dir refers to:
print $$data_dir;

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."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close