Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What Is Going On Here ?????

by autark (Friar)
on Nov 21, 2000 at 22:03 UTC ( [id://42740]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $_ = 42;
    foreach (1, 2, 3) {
       print "Inside loop: \$_ = [$_]\n";
    }
    print "Outside loop: \$_ = [$_]\n";
    
  2. or download this
    $_ = 42;
    while(<FH>) {
       print "Inside loop: \$_ = [$_]";
    }
    print "Outside loop: \$_ = [$_]\n";
    
  3. or download this
    foreach (@test_array) {
        print qq|Before while: [$_]\n|;
    
    ...
    
        print qq|After while: [$_]\n|;
    }
    
  4. or download this
    foreach my $elem (@test_array) {
        open(IN, $0) || die "No file: $!\n";
        while( defined(my $line = <IN>) ) {  }
        close IN;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://42740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-26 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found