perl contribution

Discussion in 'Perl Misc' started by robin, Mar 10, 2005.

  1. robin

    robin Guest

    I do have a contrubution it's called:
    #!/usr/bin/perl
    my $c=0; my @key;
    my $key;
    foreach ( sort %ENV)
    {
    $key= join ("=", %ENV);
    @key = split (/=/, $key);
    print "key=$key[$c]\n\n";
    print "value=$key[$c+1]\n\n---";
    ++$c;
    }
     
    robin, Mar 10, 2005
    #1
    1. Advertising

  2. "robin" <> wrote in news:1110413178.514261.222330
    @o13g2000cwo.googlegroups.com:

    > I do have a contrubution it's called:
    > #!/usr/bin/perl
    > my $c=0; my @key;
    > my $key;
    > foreach ( sort %ENV)
    > {
    > $key= join ("=", %ENV);
    > @key = split (/=/, $key);
    > print "key=$key[$c]\n\n";
    > print "value=$key[$c+1]\n\n---";
    > ++$c;
    > }


    What is it supposed to do?

    Sinan
     
    A. Sinan Unur, Mar 10, 2005
    #2
    1. Advertising

  3. robin

    Jay Tilton Guest

    "robin" <> wrote:

    : I do have a contrubution

    To what are you contributing?

    : #!/usr/bin/perl
    : my $c=0; my @key;
    : my $key;
    : foreach ( sort %ENV)

    What on Earth are you doing that for?

    : {
    : $key= join ("=", %ENV);
    : @key = split (/=/, $key);

    You can't be serious.

    : print "key=$key[$c]\n\n";
    : print "value=$key[$c+1]\n\n---";
    : ++$c;
    : }

    I'm dying here. On top of adding absurd convolutions to a trivial task,
    your program outputs incorrect information.

    print "key=$_\nvalue=$foo{$_}\n\n" for keys %foo;
     
    Jay Tilton, Mar 10, 2005
    #3
  4. robin

    John Bokma Guest

    John Bokma, Mar 10, 2005
    #4
  5. John Bokma wrote:
    > Jay Tilton wrote:
    >
    >
    >>"robin" <> wrote:
    >>
    >>: I do have a contrubution
    >>
    >>To what are you contributing?
    >>
    >>: #!/usr/bin/perl
    >>: my $c=0; my @key;
    >>: my $key;
    >>: foreach ( sort %ENV)
    >>
    >>What on Earth are you doing that for?

    >
    >
    > Greenhouse effect?
    >


    You mean he took something from the greenhouse and smoked it?

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Mar 10, 2005
    #5
  6. robin wrote:

    > foreach ( sort %ENV)


    Sigh. Robin, do you realize...

    No. No, you don't. Robin, this statement
    takes the variable names and values in your
    environment and sorts them without regard
    for which is which. Once you sort %ENV,
    you have lost which variables have which
    values--or even which strings are variables
    and which values.

    --
    Christopher Mattern

    "Which one you figure tracked us?"
    "The ugly one, sir."
    "...Could you be more specific?"
     
    Chris Mattern, Mar 10, 2005
    #6
  7. robin

    Eric Bohlman Guest

    John Bokma <> wrote in
    news:Xns9614DFF5DC3F2castleamber@130.133.1.4:

    > Jay Tilton wrote:
    >
    >> "robin" <> wrote:
    >>
    >> : I do have a contrubution
    >>
    >> To what are you contributing?
    >>
    >> : #!/usr/bin/perl
    >> : my $c=0; my @key;
    >> : my $key;
    >> : foreach ( sort %ENV)
    >>
    >> What on Earth are you doing that for?

    >
    > Greenhouse effect?


    I thought that that was primarily due to carbon dioxide rather than
    methane.
     
    Eric Bohlman, Mar 10, 2005
    #7
  8. robin

    John Bokma Guest

    Josef Moellers wrote:

    > John Bokma wrote:
    >> Jay Tilton wrote:
    >>
    >>
    >>>"robin" <> wrote:
    >>>
    >>>: I do have a contrubution
    >>>
    >>>To what are you contributing?
    >>>
    >>>: #!/usr/bin/perl
    >>>: my $c=0; my @key;
    >>>: my $key;
    >>>: foreach ( sort %ENV)
    >>>
    >>>What on Earth are you doing that for?

    >>
    >> Greenhouse effect?

    >
    > You mean he took something from the greenhouse and smoked it?


    Nah, he was messing with the ENVironment :-D.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Mar 11, 2005
    #8
  9. robin

    John Bokma Guest

    Eric Bohlman wrote:

    > John Bokma <> wrote in
    > news:Xns9614DFF5DC3F2castleamber@130.133.1.4:
    >
    >> Jay Tilton wrote:
    >>
    >>> "robin" <> wrote:
    >>>
    >>> : I do have a contrubution
    >>>
    >>> To what are you contributing?
    >>>
    >>> : #!/usr/bin/perl
    >>> : my $c=0; my @key;
    >>> : my $key;
    >>> : foreach ( sort %ENV)
    >>>
    >>> What on Earth are you doing that for?

    >>
    >> Greenhouse effect?

    >
    > I thought that that was primarily due to carbon dioxide rather than
    > methane.


    I vaguely remember that a lot of methane also has a bad effect on %ENV.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Mar 11, 2005
    #9
  10. Josef Moellers wrote:

    > You mean he took something from the greenhouse and smoked it?


    That wears off after a while. Robin's condition appears to be permanent.

    sherm--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
     
    Sherm Pendley, Mar 11, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Antoon Pardon
    Replies:
    7
    Views:
    671
    Paul Rubin
    Oct 16, 2005
  2. Detlev Offenbach

    eric4 request for contribution

    Detlev Offenbach, Jan 12, 2008, in forum: Python
    Replies:
    0
    Views:
    286
    Detlev Offenbach
    Jan 12, 2008
  3. Detlev Offenbach

    eric4 request for contribution

    Detlev Offenbach, Jan 12, 2008, in forum: Python
    Replies:
    0
    Views:
    269
    Detlev Offenbach
    Jan 12, 2008
  4. Replies:
    0
    Views:
    281
  5. Eyegor

    My little contribution, C-Profiler

    Eyegor, Nov 26, 2010, in forum: C Programming
    Replies:
    14
    Views:
    705
    Eyegor
    Nov 30, 2010
Loading...

Share This Page