Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: RFC: Is there more to alias?

by xmath (Hermit)
on Aug 25, 2004 at 18:05 UTC ( #385763=note: print w/ replies, xml ) Need Help??

in reply to Re^2: RFC: Is there more to alias?
in thread RFC: Is there more to alias?

I think I've fixed the problem, and I've uploaded a fresh version. See if this helps.

As for your original questions.. I have read your original post several times, and I have honestly no idea what you're trying to accomplish....

for alias my $line (<DATA>) {}
This is a syntax error. And "for" already aliases, so what's the deal here? On top of that, why would you need an alias to the temporary var that contains the line anyway?

alias my $line = <DATA>; while ( defined( alias my $line = <DATA> ) ) {}
These work, but again I don't see the point.. why alias $line to the read line? To prevent copying the line? I think perl already optimizes that away.

Maybe I'm just missing something, in which case please enlighten me.

Comment on Re^3: RFC: Is there more to alias?
Select or Download Code
Re^4: RFC: Is there more to alias?
by Solo (Deacon) on Aug 25, 2004 at 20:23 UTC
    Thanks, I'll try the new version.

    And I don't think you're missing anything... hope I didn't make you spin too many cycles on that.

    As I said it was a curiosity: A way to give $_ a 'pretty name' in a for or while loop. You're saying it's already the same to do:

    for $line (<DATA>) {} # or for alias $line (<DATA>) {}

    Ok. /shrug. I naively saw the named subroutine arguments as roughly the same thing. I am enlightened. =)



Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2014-12-27 06:20 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (176 votes), past polls