![]() |
New to Perl
Can someone give me an idea of what is going on with this line:
print FILE "$_\n$blocks{$_}"; I am trying to set a variable = to this amount so I can parse out some data. $someData = "$_\n$blocks{$_}" doesn't work $someData = $_\n$blocks{$_} doesn't work If more code would be helpful, I can post it. Thanks in advance |
Re: New to Perl
In article <3e439$422e02bb$97d5a94a$5413@ALLTEL.NET>, Bill Corden
<Corden@somwhere.com> wrote: > Can someone give me an idea of what is going on with this line: > > print FILE "$_\n$blocks{$_}"; This will print the contents of the variable $_, a new line, and the contents of the hash element $blocks{$_} to the file handle FILE, which presumably has been associated with a file using the open() function. > > I am trying to set a variable = to this amount so I can parse out some data. Equal to _what_ amount? Please be specific. > > $someData = "$_\n$blocks{$_}" > doesn't work This should work. It is valid Perl. It generates a string (see above for contents) and stores it in the variable $someData. Tell us why you think it "doesn't work". > $someData = $_\n$blocks{$_} > doesn't work No, this is a syntax error. > > If more code would be helpful, I can post it. Yes, you should post a complete, working, small-as-possible program that demonstrates the problem you are having and what you think the program should be doing that it is not. However, you should post it to comp.lang.perl.misc, because this newsgroup is defunct (and be sure and follow the guidelines for that newsgroup). Good luck. ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =--- |
| All times are GMT. The time now is 03:43 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.