Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Yet another array problem

by pbeckingham (Parson)
on Jul 29, 2005 at 15:19 UTC ( #479438=note: print w/replies, xml ) Need Help??


in reply to Yet another array problem

Well... The first line inside the loop is redundant, as you assign a string to an array, then overwrite that same array.

Your code below is laso relying on $_ in cases where there is no value.

Consider this:

while (<>) { for (/(\d+)/g) { print $_, "\n"; } }



pbeckingham - typist, perishable vertebrate.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://479438]
help
Chatterbox?
[Corion]: Ask about the median ;)
[jdporter]: posts like this one make me realize, ruefully, just how much my mind has deteriorated in recent years/months.
[jdporter]: "When all your nails look like trolls, all your hammers look like trolls."
erix hammers a jdporter nail randomly

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2018-06-21 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?