![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ! operator in variable | mmunir | Shell Programming and Scripting | 1 | 05-30-2008 04:29 AM |
| perl scalar variable in backquoted string | mehdi9 | Shell Programming and Scripting | 6 | 10-09-2007 03:33 PM |
| what is diff b/w copy constructor and overloaded assignment operator | amitpansuria | High Level Programming | 3 | 08-06-2007 04:45 PM |
| Can't modify not in scalar assignment compilation error | new2ss | Shell Programming and Scripting | 2 | 05-18-2006 06:03 AM |
| @ in a variable assignment | rkap | UNIX for Dummies Questions & Answers | 1 | 05-23-2005 11:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
scalar variable assignment in perl + { operator
When reading over some perl code in a software document, I came across an assignment statement like this
$PATH = ${PROJECT}/......./.... In this particular form of scalar variable assignment, what does the curly braces operators do ? Also, what is the benefit in doing scalar assignment this way ? many thanks |
|
||||
|
Surrounding the identifier with curly braces is more frequently seen in double-quoted strings to separate it from neighbouring text. For example,
"The time now is ${time}A.M." This syntax also works outside strings, as you cited, but that is rarely needed and being most of the time redundant. It is there to support identifiers that start with a ^ sign, which is normally not allowed. However, I cannot think of any case that really needs to refer this kind of variables. For more information, refer to perlvar - perldoc.perl.org |
![]() |
| Bookmarks |
| Tags |
| perlvar |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|