Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Use scalars to define a filename

by Utilitarian (Vicar)
on Oct 17, 2011 at 14:13 UTC ( #931934=note: print w/replies, xml ) Need Help??


in reply to Use scalars to define a filename

The underscore is a legitimate character in a variable name,so you'll have to create to the file in one of the following ways
my $fileName = "fileLocn/".$var1."_$var2.txt"; my $fileName = "fileLocn/${var1}_$var2.txt"; my $fileName = sprintf("fileLocn/%s_%s.txt", $var1, $var2);
Or one a a myriad others

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://931934]
help
Chatterbox?
[LanX]: shmem: but only because it is taught in school
LanX remembers one curriculum about benny and the punishment whe we didn't laugh ...hill
LanX horror
[Discipulus]: in case of doubt freedom
[LanX]: consideration is a democratic process
[Discipulus]: i'm sure germans has humor: i see them laughing

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2017-04-27 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (513 votes). Check out past polls.