Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Variable Scoping in Perl: the basics

by Aristotle (Chancellor)
on Dec 24, 2004 at 01:50 UTC ( #417232=note: print w/ replies, xml ) Need Help??


in reply to Re: Variable Scoping in Perl: the basics
in thread Variable Scoping in Perl: the basics

Try

print "$Robert has canned ${name}'s sorry butt\n";

The apostrophe is the old-style package separator, still supported, so $name's is indeed equivalent to $name::s. By putting the curlies in there, you tell Perl exactly which part of the string to consider part of the variable name, and which part to consider a literal value.

Makeshifts last the longest.


Comment on Re^2: Variable Scoping in Perl: the basics
Download Code
Re^3: Variable Scoping in Perl: the basics
by aristotle73 (Sexton) on Dec 24, 2004 at 02:11 UTC
    Thanks :D It works ^_^

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-10-02 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls