Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: \G assertion

by fishbot_v2 (Chaplain)
on Aug 02, 2005 at 18:25 UTC ( #480275=note: print w/replies, xml ) Need Help??

in reply to \G assertion

I need to print from one string to another using .. with \G My goal is to capture from allsets down.

Capture into what? A string? An array? If you just want to capture everything from /allsets/ .. /fs_clinical\.1/ into a scalar string then you can just do something like:

my $captured = ""; while ( <ARC> ) { $captured .= $_ if ( /allsets/ .. /fs_clinical\.1/ ); }

...but you seem to be trying to do something more. I don't know what you are trying to do with the / \G 'heartlab.1'/, but that isn't doing anything at all currently. \G generally doesn't make any sense unless it is used with /g and in some sort of a looped match. You don't have a looped match here, since you are changing the match-subject on each iteration.

Additionally, $1 is populated by (successful) capturing matches. You don't have any of those, so $1 is empty, if you are lucky. Mind you, you are assigning to a variable in a uselessly small scope, so it doesn't matter anyway.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2023-09-21 08:53 GMT
Find Nodes?
    Voting Booth?

    No recent polls found