Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: substring exists at particular postion?

by jmcnamara (Monsignor)
on May 23, 2002 at 10:19 UTC ( [id://168732]=note: print w/replies, xml ) Need Help??


in reply to Re: substring exists at particular postion?
in thread substring exists at particular postion?


If you are going to match the same position more than once, as indicated by your code, then you should store the value from a single call to substr and use that in the subsequent if statements:
while(<IN>) { my $tmp = substr($_, 259, 1); if($tmp eq "B") { print B $_; } else if ($tmp eq "T") { print T $_; } else if () { # and so on for at least 10 lines!... } }

--
John.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-05-28 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found