Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Creating dynamic variables

by flexvault (Monsignor)
on Jan 03, 2013 at 10:59 UTC ( #1011438=note: print w/replies, xml ) Need Help??


in reply to Creating dynamic variables

Hello rbala,

I'm guessing, but is this what you want to do?

perl -e '$x="hello "; while( $y=glob("*") ) { print "$x$y\n"; }'

If you had 'use strict' in your code, you would have gotten an error on your second line. I'm using 'glob', but any source of input and assignment of '$y' will work.

When using Perl, you should think of how to do it with Perl. Your experience with 'makefile' is nice, but has nothing to do with what is correct in Perl!

Good Luck!

"Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011438]
help
Chatterbox?
[Happy-the-monk]: Discipulus: are there any perl monks in Milano?
[Discipulus]: i the moment likely no
[karlgoethebier]: i wonder now it will be with my glasses.
[Discipulus]: Milan Perl Mongers seems frozen at 2009
[Discipulus]: karl you dont shoot with eyes, you shoot with the soul
[jkva]: Reminds me of Guardians of the Galaxy
[erix]: OT++: /me came across an osprey (=visarend (=Fischadler)) just now

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2017-10-20 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?