Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Testing a string for a range of characters

by Fastolfe (Vicar)
on Jan 24, 2001 at 20:36 UTC ( [id://54025]=note: print w/replies, xml ) Need Help??


in reply to Testing a string for a range of characters

In addition, if you're really worried this much about performance, your hash creation could be simplified:
my %hash; @hash{'A'..'Z'} = (); ... if (exists $hash{$whatever}) { ... }

Replies are listed 'Best First'.
Re: Re: Testing a string for a range of characters
by BoredByPolitics (Scribe) on Jan 24, 2001 at 21:02 UTC
    Aha! That's what tilly had suggested, but without the my %hash; first, and I was getting confused when trying to combine the my and assignment in the same statment! Thanks Fastolfe, I'd not seen that particular usage before :-)

    As regards your other reply, currently I'm shifting off the first element of the array, which tells me what the record type is. I then join the array with a delimiter for writing out to a flat file, minus the transaction type (or rather the transaction type get's built into the key I insert with the join).

    Pete

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found