Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: flip-flop interpolation

by GotToBTru (Prior)
on May 13, 2015 at 18:25 UTC ( [id://1126581]=note: print w/replies, xml ) Need Help??


in reply to flip-flop interpolation

$i = 2; $j = 4; print "$_\n" for ($i..$j);

Output:

2 3 4

Update: I missed what was obvious to choroba. Not so much a flip-flop as a filter:

# show lines 2 thru 4 while (<>) { print if 2..4 } # this will print every line $i = 2; $j = 4; while (<>) { print if $i..$j }
Dum Spiro Spero

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found