Help for this page

Select Code to Download


  1. or download this
    package test;
    foreach ( 1..3 ){
        print "Here: '$1'.\n";
    }
    1;
    
  2. or download this
    unshift @INC, '.';
    my $var = "abc123def";
    $var =~ /(\d+)/;
    require test;
    
  3. or download this
    Here: '123'.
    Here: '123'.
    Here: '123'.
    
  4. or download this
    $var = 'foobar';
    $var2 = ( $var =~ /(foo)(bar)/);
    print $var2;
    
  5. 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") };
        }
    
  6. or download this
    $var = '$varnameA';
    $var =~ s/^(\W)//;
    print "Symbol: $1\tVariable: $var\n";
    
  7. or download this
    Symbol: $    Variable: varnameA