Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: A few random questions from Learning Perl 3

by blokhead (Monsignor)
on Jan 06, 2003 at 04:52 UTC ( #224542=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
        my $counter = 0;
        sub inc_counter { $counter++ };    # $counter is visible here
        sub get_counter { $counter };      # and here
    }
    
  2. or download this
    $/ = "\n";
    my $line = <STDIN>;     # <> operator reads just one line
    ...
    }
    
    $line = <STDIN>;        # reads just one line again, since $/ returns 
    +to "\n"
    
  3. or download this
    for (0 .. 100) {
      next unless $_ % 2;     # skip multiples of 2
      next unless $_ % 5;     # skip multiples of 5
      print "$_\n";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2020-02-18 00:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (74 votes). Check out past polls.

    Notices?