28 April 2011

แสดงค่าตำแหน่งของข้อมูลที่เก็บบน memory

#!c:\perl\bin\perl.exe

use strict;
use CGI;

my $cgi = CGI->new;
print $cgi->header("text/html");

my $data = "myData";
my $ref = \$data; #$ref จะเก็บค่าตำแหน่งของ $data
print $ref."<br>"; # แสดงค่าตำแหน่ง
print $$ref."<br>"; #ใช้ค่าของตำแหน่งแสดงข้อมูลที่ตำแหน่งนั้น
print ${$ref}; #แสดงข้อมูลที่ตำแหน่งนั้น

0 comments:

Post a Comment