eval doesn't work, i don't want anything happening other than variable replacement either. but i did finally figure out how to do it.
s/\${(.)}/${${1}}/g;
this replaces all instances of literal ${blahblah} with the variables value ;-)
if i load lines from a file that have ${a} in them, how do i get perl to replace ${a} with the variable ${a}?
i know i can do: s/\${a}/${a}/g
but i want it to do ALL variables at once...any help?
How oh how does one pass a file handle to a sub? The reason I want to do this is because I have a sub to print out data to a file, and I want it to print out to where the handle is currently at. So I don't want to pass the filename...I want to pass the handle....how does one do it???
-John
That's cool, actually I like that method because I have to prefix my calls.
myPackage::FuncA;
Is there a way to have FuncA within the scope of the main perl file so you can just
FuncA;
I don't really need it, I like the other method, but Iw as just wondering ;)
John
I'm rather new to perl. I wan to know how to include other perl scripts into my perl script. For example, I have a file called 'website.pl' that has all of my nifty perl subs that I use. Then I write a script in 'newsupdate.pl' and I want to use the subs from the 'website.pl' file.
I'd rather...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.