Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Delete till end of line to another string

by si_lence (Deacon)
on Aug 19, 2009 at 07:06 UTC ( [id://789709]=note: print w/replies, xml ) Need Help??


in reply to Re: Delete till end of line to another string
in thread Delete till end of line to another string

Not really.

If there is a line in the input data that has neither a > or a { it will produce a wrong result.

use strict; use warnings; while (<DATA>) { $_ =~ m/\{/g; my $str = $`; my $str1=$'; $str=~ s/\>//g; print $str."{".$str1; } __DATA__ testline1 EVITE LA ENFERMEDAD PERIODONTAL< EVITE LA ENFERMEDAD PERIODONTAL< AS {IT}CTIQUE LA HIGIENE DENTAL PARA CUIDAR SUS ENCĂ testline2 testline3
produces the output
Use of uninitialized value in substitution (s///) at ... Use of uninitialized value in concatenation (.) or string at ... <snip other warnings> {{{{IT}CTIQUE LA HIGIENE DENTAL PARA CUIDAR SUS ENCĂ <snip more warnings> {IT}CTIQUE LA HIGIENE DENTAL PARA CUIDAR SUS ENCĂ <snip more warnings> {IT}CTIQUE LA HIGIENE DENTAL PARA CUIDAR SUS ENCĂ

cheers, si_lence

I apologize for the lack of exclamation marks in this post

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found