Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Single quotes don't interpolate variables. You need double quotes.
Note that I needed to add the comma after the mode, it's not optional. Also, a backslash is special in double quotes, so it needs to be backslashed to keep its literal meaning. Moreover, a variable name can't be followed by an underscore (or any other character valid in a variable name) in double quotes, e.g. "$x_" means the variable named $x_, not $x followed by an underscore; you might need to use the curly braces syntax "${x}_". Even better, use sprintf:
The usual rant about using lexical filehandles will come shortly.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In reply to Re: file open with variables
by choroba
|
|