Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: split function against a HTML code

by greatshots (Pilgrim)
on Nov 26, 2007 at 06:44 UTC ( #652928=note: print w/replies, xml ) Need Help??


in reply to Re: split function against a HTML code
in thread split function against a HTML code

open ( FH , "sample.html") or die "Unable to open the file :$!:"; while ( <FH> ) { chomp; my $line = $_; if ( $line =~ />KPI</i ) { print "$line\n----------------------\n"; my @line_split = ('<',$line); print "LINE_SPLIT :",@line_split,"-----",$#line_split,"\n"; my @result = map ( $_ ne '' , @line_split); print "Join :",join('-',@result); close (FH); } }
I tried the above code. But the split does not split the input line as expected. :-/

Replies are listed 'Best First'.
Re^3: split function against a HTML code
by mreece (Friar) on Nov 26, 2007 at 15:28 UTC
    my @line_split = ('<',$line);
    looks like you neglected to call the split function at all: my @line_split = split('<', $line);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2021-02-25 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?