Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: flip-flop interpolation

by Anonymous Monk
on May 13, 2015 at 10:31 UTC ( [id://1126537]=note: print w/replies, xml ) Need Help??


in reply to Re: flip-flop interpolation
in thread flip-flop interpolation

Thank you.
And can't I say to Perl to use my $i and $j as constants?

Replies are listed 'Best First'.
Re^3: flip-flop interpolation
by SuicideJunkie (Vicar) on May 13, 2015 at 14:47 UTC

    That is like asking to draw a red line using green ink :)

    The way to do it is to use the green ink to define a universe containing hardcoded red lines:

    #untested, and quite silly eval "print $_ if $i .. $j;";
Re^3: flip-flop interpolation
by johngg (Canon) on May 13, 2015 at 15:45 UTC

    You could use the constant pragma but it is not really saving you anything.

    $ seq 1 6 > lines $ cat lines 1 2 3 4 5 6 $ perl -ne ' > use constant { I => 3, J => 5 }; > print if I .. J;' lines 3 4 5 $

    I hope this is of interest.

    Cheers,

    JohnGG

Re^3: flip-flop interpolation
by Anonymous Monk on May 13, 2015 at 10:38 UTC

Log In?
Username:
Password:

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

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

    No recent polls found