Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Re: Re: How to remove the $1 hard coding

by chunlou (Curate)
on Aug 22, 2003 at 19:37 UTC ( #285899=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: How to remove the $1 hard coding
in thread How to remove the $1 hard coding

Probably you meant this.

push @a, ('a b c'=~/(\w) /g)[1]; print "@a";
You need () to capture something into the array. You need the switch /g if you want to put every match into an array, not just the first match (hence for the index [$i] to work).


Comment on Re: Re: Re: Re: How to remove the $1 hard coding
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2015-07-05 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls