Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
P is for Practical
 
PerlMonks  

Re: Parsing a string from a file

by chas (Priest)
on Jun 11, 2005 at 13:30 UTC ( [id://465825]=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 Parsing a string from a file

If you are using double quotes as you indicate, there isn't an interpolation problem; am I missing something?
my @time = (1, 2, 3); my $counter = 5; my $s = "Today is $time[1] and you have seen this $counter times!"; @messages=($s); foreach $m(@messages){print "$m\n";}

Output:
Today is 2 and you have seen this 5 times!
chas
(Update: Also, if I read the lines from a file using the diamond operator and push them onto @messages, it seems to work fine.)

Log In?
Username:
Password:

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