YUANya

导航

 

$val部分

#!/usr/bin/envperl

use strict;
use warnings;



my $number = 3;

$number **= 3;

print "$number\n"; 

##27

print "lucky number is " , 8*11,".\n" ;

##lucky number is 88.

my $empty_number ;

print "This is a $empty_number\n"; 

##Use of uninitialized value $empty_number in concatenation (.) or string at test.pl line 22.
##This is a  

my $apple = "apple";

#print "such $apple[]\n";

print "such $apple\[\]\n";

##Global symbol "@apple" requires explicit package name (did you forget to declare "my @apple"?) at test.pl line 29.syntax error at test.pl line 29, near "[]"
##such apple[]

#print "such $apple{}\n";

print "such $apple\{\}\n";

##Global symbol "%apple" requires explicit package name (did you forget to declare "my %apple"?) at test.pl line 33.syntax error at test.pl line 33, near "{}"
##such apple{}

print "such $apple::\n";

print "such $apple\:\:\n";

##Use of uninitialized value $apple:: in concatenation (.) or string at test.pl line 43.
##such 
##such apple::

print "such $apple'\n";

print "such $apple\'\n";

##such apple'
##such apple'

my $big = "big";

print "I like $big $apples\n";

##Global symbol "$apples" requires explicit package name (did you forget to declare "my $apples"?) at test.pl line 60.
##Execution of test.pl aborted due to compilation errors.

print "I like $big ${apple}s\n";

print "I like $big" . " " . "$apple" . "s\n";

##I like big apples
##I like big apples

这里的apple::实际上是什么?

my $apple = "apple";

print "such $apple::\n";

print "such $apple\:\:\n";

##Use of uninitialized value $apple:: in concatenation (.) or string at test.pl line 43.
##such 
##such apple::
posted on 2019-06-09 20:19  YUANya  阅读(143)  评论(0编辑  收藏  举报