Re: New to Perl

From: Jim Gibson (jgibson_at_mail.arc.nasa.gov)
Date: 03/08/05

  • Next message: ray d: "Re: Dirty Arrays and how to clean them up!"
    Date: Tue, 08 Mar 2005 13:40:09 -0800
    
    

    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 =---


  • Next message: ray d: "Re: Dirty Arrays and how to clean them up!"

    Relevant Pages

    • Re: Paul Holland re CB
      ... not wanting to share CB's private information with me or the newsgroup ... in that regard he is 'equal opportunity' ... any law enforcement office would need only a scant amount of time to ... find who and where he is - he's not hiding from anyone. ...
      (alt.med.fibromyalgia)
    • Re: New UK genealogical site
      ... site on this newsgroup, because of the amount of negativity here. ... There are some features of the site that I feel do make it ...
      (soc.genealogy.britain)
    • Re: Space Between Paragraphs
      ... I usually use Space After for Body Text, plus a large amount of Space Before ... See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome! ... This message is posted to a newsgroup. ... this -- space between paragraphs and where to add it when it's called ...
      (microsoft.public.word.newusers)
    • Is there a present day equivalent of this Check Mate/Check Writer?
      ... I do not know whether this is a valid newsgroup for this ... United States Purchasing Exchange is no longer in business. ... check (date, Pay to the order of, the amount where you write the numerical ... I have hit the end of the ribbon. ...
      (misc.consumers)