Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: array problem

by YuckFoo (Abbot)
on Mar 15, 2002 at 14:18 UTC ( #151985=note: print w/replies, xml ) Need Help??


in reply to array problem

Your immediate problem is here:

s/%%images%%/@arr/g;

Try:

s/%%images%%/shift(@arr)/eg;

This will remove and use the first element of @arr as a replacement. Note the addition of the 'e' modifier, to evaluate the replacement expression.

Not sure why using @arr in s// yields a single item. The item it picks seems to be arbitrary as well.

Also, shoot for 'use strict;' on all your programs and quit using global variables.

YuckFoo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-01-29 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?