functions in perl such as tr, s etc
The functions such as s can only be used for variables such as $variable.
Is there any way to use it with arrays too so that it substitutes for each string in all of the array indexes. I know we can do it using foreach loop or any other loop. But is there any inbuilt function to do it? It'd save me a lot of time. Thanks in advance. |
No.
"Regular expressions" act on "strings". Not arrays. Sorry :) |
perldoc -f map
--- rod. |
Hi, theNBomr -
Cool - I never knew that :) Thank you. However, perldoc also goes on to say that a straightforward "foreach" is usually preferable: Quote:
|
Yes, as usual in Perl, there's more than one way to do almost anything.
--- rod. |
Quote:
|
All times are GMT -5. The time now is 06:38 PM. |