Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
We don't bite newbies here... much
 
PerlMonks  

Re: problematice metashar regexp

by gjb (Vicar)
on Apr 27, 2004 at 18:13 UTC ( [id://348654]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to problematice metashar regexp

One of the things that may go wrong is that you substitute in the result of a substitution. Consider the first character 'h', it's replaced by '^', but '^' can in turn be replaced by '~', depending on the order of the keys, something you don't control in a hash. Maybe this effect is intentional, but if not, it could be the source of your problem. If so, replace the global substitution by a while over the characters of the string.

Hope this helps, -gjb-

Replies are listed 'Best First'.
Re: Re: problematice metashar regexp
by Anonymous Monk on Apr 28, 2004 at 09:42 UTC
    This is most likely the problem.

    I have to say, this was pretty darn intuitive of you, and I really appreciate the help.

    Since I'm trying to stop benig such a hack (ugly code, procedural, use strict, etc.), is this the prettyiest way to while over a string?

    #!/usr/bin/perl -w use strict; my $string="wheristhelove"; my @array=split(/\s*/, $string); foreach (@array){ ...
    Again, thank you so much for your help!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://348654]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.