I am trying to concatenate
some text, a scaler, and more text
to create a reference. I am not quite getting there. the code:

#!/usr/bin/env perl use strict; use warnings; my $MaxScanId = 45; my $a = "Scan"; my $b; my $c; my $d; print "a $a, maxScanId $MaxScanId \n\n"; $b = "Max".$a."Id"; $c = "\$".$b; print "c: $c \n\n"; $d = \$c; print "d: ${$d} \n";
results: a Scan, maxScanId 45 c: $MaxScanId d: $MaxScanId

The results of the final print are not quite what I was looking for, (I expected the contents of $MaxScanId, 45)
What am I missing. I am sure there is a simpler way to do this (in a single step, perhaps),
But I have only been using perl about 30 days so I need lots of help
Always did, but that's another issue

$a is the name of a database table, ScanId is the primary key, and $MaxScanId holds
the value of the next available id (saves an SQL query each time the routine is called).
Largins


In reply to Concatenation of scaler reference by Largins

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.