Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Script/module formatting gotcha

by oko1 (Deacon)
on Oct 06, 2010 at 14:06 UTC ( #863794=note: print w/replies, xml ) Need Help??


in reply to Script/module formatting gotcha

As jettero pointed out, it's an rvalue assignment - and although the code in the example that you cite isn't doing anything worthwhile, the mechanism itself is a perfectly valid and useful one. Without it, you couldn't do things like

die "Syntax: [...]\n" unless my $fname = shift;

and so on. I think that the right perspective here is that the tools are available and usable, but the decision about whether something is useful or not is up to the human. :)


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf

Replies are listed 'Best First'.
Re^2: Script/module formatting gotcha
by mjscott2702 (Pilgrim) on Oct 06, 2010 at 15:27 UTC
    Understood, and I have no problem with the rvalue itself being an lvalue (if that makes sense).

    My only point here was that splitting this construct across multiple lines, with a large number of comments in-between, makes the script difficult to read - the construct itself is clear, and useful :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863794]
help
Chatterbox?
[LanX]: but I don't understand the question...
[GotToBTru]: okay, I see what it does
[GotToBTru]: you;ve answered it .. the expression is meant to be evaluated as written, it is not a symbol for a special operation
[LanX]: '&;@' is a parsing error
[GotToBTru]: by itself, yes, but used in sub pre(&;@) not so
[LanX]: &; is interpreted as a function call, but the @ has no meaning
[LanX]: OH
[LanX]: you are talking about signatures?
[GotToBTru]: yes, it turns out I am
[LanX]: http://perldoc. perl.org/perlsub. html#Prototypes

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-01-18 21:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (164 votes). Check out past polls.