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

Re: Removing multiple trailing comment lines from a string (array of tokens)

by Anonymous Monk
on Dec 23, 2016 at 04:22 UTC ( [id://1178406]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     
    push @stack, [ COMMENT => $1 ];
    ...
    $stack[-1][0] eq 'COMMENT' and pop @stack for 1..3;
    
  2. or download this
    $ perl -le " $_ = qq{;banana\n;ro\n;sham\n;bo\n}; print; s{(?:^;[^\r\n
    +]*[\r\n]+){1,3}\Z}{}m; print; "
    ;banana
    ...
    ;bo
    
    ;banana
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-03-28 20:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found