Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Variable in a string

by Old_Gray_Bear (Bishop)
on Dec 09, 2011 at 19:15 UTC ( #942720=note: print w/replies, xml ) Need Help??

in reply to Variable in a string

You can build your name in stages:
my $file_name = "CAC1Bvariant"; $file_name .= $variable; $file_name .= '_fasta.txt';
I think it's a little easier on the maintenance programmer's eyes, and it high-lights the fact that the varying part of the name is in the middle of the string.

I Go Back to Sleep, Now.


Replies are listed 'Best First'.
Re^2: Variable in a string
by hbm (Hermit) on Dec 09, 2011 at 20:00 UTC

    Sleepy Bear,

    Might this be even easier on the eyes?

    my $file_name = 'CAC1Bvariant' . $variable . '_fasta.txt';
      You guys are awesome. I've used this site for 10 years and have valued it every time I've asked a question (though haven't in 8 years, and forgot my user info!)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942720]
[atcroft]: stevieb: I have berrybrew installed on a Win machine, and I noticed that with perlbrew you can "upgrade" a particular installed version... any chance of doing something similar in the
[atcroft]: future with berrybrew?
[atcroft]: stevieb: Also, one other odd question... is it possible to set it up so that all the versions installed can use a single directory that they pull module sources into, rather than duplicating files? (Am I making sense, or do I have too high a CBC
[atcroft]: (caffeine-blood content) atm?)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2017-04-29 05:11 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.