Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: get data from the database -CGI

by mjscott2702 (Pilgrim)
on Nov 09, 2010 at 15:47 UTC ( #870323=note: print w/ replies, xml ) Need Help??


in reply to Re: get data from the database -CGI
in thread parsing a txt file

I have used the standard "flip-flop" .. operator for similar things, but always had to explicitly exclude the start and end points i.e. marker1 and marker2.

Does the ... remove the need for this? Is this only for more recent Perl versions (still stuck on 5.8)?


Comment on Re^2: get data from the database -CGI
Re^3: get data from the database -CGI
by moritz (Cardinal) on Nov 09, 2010 at 18:19 UTC
    Why don't you just try it?
    Perl 6 - links to (nearly) everything that is Perl 6.
      Fair enough, so I did, using the following:
      while(<DATA>) { print if (/line1/ ... /line5/); } __DATA__ line1 line2 line3 line4 line5

      Outputs all the lines, including the start and end "markers". So, unless I am doing something wrong, I don't see how this is any different from the .. operator I have used in the past (at least under 5.8)?

      Reason I didn't just try it (which I should have anyway, admittedly) is that I thought myself and others would benefit from a little further explanation.

      Guess it's RTFM time for me...

        OK, from perlop:

        If you don't want it to test the right operand till the next evaluation, as in sed, just use three dots ("...") instead of two. In all other regards, "..." behaves just like ".." does.

        Not really sure what the difference is, so I'll stick with my normal two dot approach.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-08-01 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls