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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |