#!/usr/bin/perl -w
use strict;
use warnings;
use Class::Struct;
struct System => {
Name => '$',
};
my $system = new System;
$system->Name("Server1");
my $strout1 = qq{Server is ${$system->Name}\n};
my $strout2 = "Server is \"".$system->Name."\"\n";
print $strout1;
print $strout2;
results in:
Can't use string ("Server1") as a SCALAR ref while "strict refs" in use at test.pl line 14.
I want to be able to use qq and deref $system->Name
correctly. Can anyone explain where i am going wrong?