- or download this
package test;
foreach ( 1..3 ){
print "Here: '$1'.\n";
}
1;
- or download this
unshift @INC, '.';
my $var = "abc123def";
$var =~ /(\d+)/;
require test;
- or download this
Here: '123'.
Here: '123'.
Here: '123'.
- or download this
$var = 'foobar';
$var2 = ( $var =~ /(foo)(bar)/);
print $var2;
- or download this
foreach $sym (@imports) {
# shortcut for the common case of no type character
...
$type eq '*' ? *{"${pkg}::$sym"} :
do { require Carp; Carp::croak("Can't export symbol: $type
+$sym") };
}
- or download this
$var = '$varnameA';
$var =~ s/^(\W)//;
print "Symbol: $1\tVariable: $var\n";
- or download this
Symbol: $ Variable: varnameA