Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: use constant usage clarification

by BrowserUk (Patriarch)
on Oct 31, 2014 at 06:21 UTC ( [id://1105700]=note: print w/replies, xml ) Need Help??


in reply to use constant usage clarification

[this]' gives a scalar assignment error use constant x = 1/3

Really? Cos when I try it, the error is: Unquoted string "x" may clash with future reserved word.

Care to post a short script that produces that error when run?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: use constant usage clarification
by Discipulus (Canon) on Oct 31, 2014 at 08:45 UTC
    Hello BrowserUK i'm receiving too an assignement error using the wrong syntax with the not stringified left value:
    #(something like:) perl -MConfig -e "BEGIN{print 'Perl ', map {$Config{$_},' '}qw/version + os archname/ }; use constant X = 1/3;print qq(\n),+X,qq(\n)" ----------------------------------------······· | Can't modify constant item in scalar assignment at -e line 1, near +"3;" | BEGIN not safe after errors--compilation aborted at -e line 1. | Perl 5.14.2 MSWin32-x86-multi-thread -------------------------------------------------------------------- +---······· ----------------------------------------······· | Can't modify constant item in scalar assignment at -e line 1, near +"3;" | BEGIN not safe after errors--compilation aborted at -e line 1. | Perl 5.20.0 MSWin32-x86-multi-thread-64int -------------------------------------------------------------------- +---······· ----------------------------------------······· | Can't modify constant item in scalar assignment at -e line 1, near +"3;" | BEGIN not safe after errors--compilation aborted at -e line 1. | Perl 5.16.2 MSWin32-x64-multi-thread -------------------------------------------------------------------- +---·······

    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-18 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found