Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Just another Perl shrine
 
PerlMonks  

Re^2: Simple regexp question

by SamCG (Hermit)
on Mar 31, 2006 at 13:17 UTC ( [id://540523]=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 Re: Simple regexp question
in thread Simple regexp question



TIMTOWTDI
I'd change my $ast = $_ =~ s/\*/$&/g; to my $ast = tr/*//;, and do similarly for the $hah variable. Or, leaving the default variable intact, my $ast = tr/*/*/;. To each their own.

Of course, the code doesn't "filter out lines with *'s and #'s" -- it prints a line of asterisks with the line number, and then prints the number of asterisks and number of hashes. I take it you simply intended to give the OP some code to work on without giving everything, while pointing out the question should have indicated some effort on his part.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://540523]
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.