upgrading perl to 5.6 from 5.005_03 question?

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default upgrading perl to 5.6 from 5.005_03 question?

    Hello: I have perl 5.005_03 on solaris 2.8 which was
    installed with the OS. I would like to upgrade it to
    5.6. Should I pkgrm the existing perl before I install
    the new perl ? or is there any other recommended way
    to upgrade.

    Thanks
    Ravi

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free web site building tool. Try it!
    [url]http://webhosting.yahoo.com/ps/sb/[/url]
    Ravi Malghan Guest

  2. Similar Questions and Discussions

    1. Upgrading Question
      I have put his off long enough... Is it possible to upgrade from Illustrator 9 to CS, or do I have to get 10? Is it possible to upgrade my OS...
    2. Upgrading Perl linux 5.6 rpm to 5.8.2 source
      On a Linux system how can I remove the 5.6 rpm and then install the 5.8.2 from source and still maintain dependencies? If something is looking for...
    3. Upgrading from Perl 5.8.0 to Perl 5.8.2
      I'm using Redhat 9.0 and after installing it, I came with Perl 5.8.0. Well, I tried to upgrade to 5.8.2 and instead of upgrading, it just installed...
    4. How Can I Install PERL Modules w/o Upgrading PERL?
      Shalom! I absolutely hate it when I install a required module for one piece of software or another, and suddenly it begins installing the...
    5. Question about upgrading IDS
      Hi all, I am new in informix database administration. I am currently using IDS 9.21.UC4 on Solaris7. However, it run very unstable, which usually...
  3. #2

    Default Re: upgrading perl to 5.6 from 5.005_03 question?

    Ravi,

    I just upgraded from 5.6 to 5.8.0, and I can tell you I am VERY happy that
    I left both perl installs intact, because it allowed me to compare the
    operation of my code under each version. If there was a difference in how
    my code worked, it was due to a change in the Perl version or my
    installation of it. Fortunately I had a robust set of test cases to help
    me track down any changes.

    While I can't speak specifically about the differences between 5.005 and
    5.6, I would very much want to leave 5.005 in place until I was satisfied
    that 5.6 was installed and working. During the transition, you could have
    one login with the environment (PERL5LIB, PATH etc) set to use the old Perl
    and a different login that uses the new. Or somthing like that.

    At 08:51 AM 2/2/04 -0800, Ravi Malghan wrote:
    >Hello: I have perl 5.005_03 on solaris 2.8 which was
    >installed with the OS. I would like to upgrade it to
    >5.6. Should I pkgrm the existing perl before I install
    >the new perl ? or is there any other recommended way
    >to upgrade.
    >
    >Thanks
    >Ravi
    >
    >__________________________________
    >Do you Yahoo!?
    >Yahoo! SiteBuilder - Free web site building tool. Try it!
    >[url]http://webhosting.yahoo.com/ps/sb/[/url]
    >
    >--
    >To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    >For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    ><http://learn.perl.org/> <http://learn.perl.org/first-response>
    >
    >
    >
    >
    Michael C. Davis Guest

  4. #3

    Default Re: upgrading perl to 5.6 from 5.005_03 question?

    Ravi Malghan wrote:
    >
    > I have perl 5.005_03 on solaris 2.8 which was
    > installed with the OS. I would like to upgrade it to
    > 5.6. Should I pkgrm the existing perl before I install
    > the new perl ? or is there any other recommended way
    > to upgrade.
    Hi Ravi.

    What do you mean by
    > Should I pkgrm the existing perl
    If you have any Perl software that may rely on the current
    version of Perl, then you should be careful. OTOH, if this is a
    new installation without any Perl programs, then install a
    recognised version of Perl as soon as you can. A version
    'installed with the OS' isn't a safe place to start.

    Rob




    Rob Dixon Guest

  5. #4

    Default RE: upgrading perl to 5.6 from 5.005_03 question?

    Instead of upgrading why not just install Perl 5.6 in a separate directory......just a thought!

    Tony Esposito
    Oracle Developer, Enterprise Business Intelligence
    XO Communications
    Plano, TX* 75074
    Work Phone: 972-516-5344
    Work Cell: 972-670-6144
    Email: [email]anthony.esposito@xo.com[/email]*


    -----Original Message-----
    From: Rob Dixon [mailto:rob@dixon.port995.com]
    Sent: Monday, February 02, 2004 12:50 PM
    To: [email]beginners@perl.org[/email]
    Subject: Re: upgrading perl to 5.6 from 5.005_03 question?

    Ravi Malghan wrote:
    >
    > I have perl 5.005_03 on solaris 2.8 which was
    > installed with the OS. I would like to upgrade it to
    > 5.6. Should I pkgrm the existing perl before I install
    > the new perl ? or is there any other recommended way
    > to upgrade.
    Hi Ravi.

    What do you mean by
    > Should I pkgrm the existing perl
    If you have any Perl software that may rely on the current
    version of Perl, then you should be careful. OTOH, if this is a
    new installation without any Perl programs, then install a
    recognised version of Perl as soon as you can. A version
    'installed with the OS' isn't a safe place to start.

    Rob





    --
    To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    <http://learn.perl.org/> <http://learn.perl.org/first-response>


    Anthony Esposito Guest

  6. #5

    Default Re: upgrading perl to 5.6 from 5.005_03 question?

    Anthony Esposito wrote:
    >
    > Instead of upgrading why not just install Perl 5.6 in a
    > separate directory......just a thought!
    Fine, unless you have several people writing software for your
    central core. Otherwise, obviously, they need to have a common
    version of Perl.

    Rob


    Rob Dixon Guest

  7. #6

    Default Re: upgrading perl to 5.6 from 5.005_03 question?


    At 08:51 AM 2/2/04 -0800, Ravi Malghan wrote:
    > Hello: I have perl 5.005_03 on solaris 2.8 which was
    > installed with the OS. I would like to upgrade it to
    > 5.6. Should I pkgrm the existing perl before I install
    > the new perl ? or is there any other recommended way
    > to upgrade.
    you might check with Sun, I think that they have
    a patch that will upgrade their version of perl
    that is actually in /usr/perl5.

    So what you can do is build a version of perl 5.8.3
    and install it in /usr/local/ you can then make the
    symbolic link for /usr/bin/perl point at /usr/local/bin/perl
    and Sun's stuff will work in it's own space, since it
    is built to look for /usr/perl5/bin/perl

    eg
    vladimir: 59:] head /usr/bin/kstat | sed 's/^/ /'
    #!/usr/perl5/bin/perl
    #
    # Copyright (c) 1999, 2001 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    #ident "@(#)kstat.pl 1.3 01/11/09 SMI"

    require 5.6.1;
    use strict;
    use warnings;
    vladimir: 60:]

    HTH.

    ciao
    drieux

    ---

    Drieux Guest

  8. #7

    Default Need help sorting by specific fields in file.

    Greetings;

    I have a file that I need to sort and currently I am just
    sorting it by

    @datalist = sort(@datalist);

    but it will eventually have many more records and many of
    them may be quite large, but I only need to sort on the
    first six characters which would be faster. Wouldn't it?

    I have looked at perldoc and it shows things like

    @articles = sort {$a <=> $b} @files;

    but I can't figure out how to tell the sort that $a and $b
    are the first six characters of @datalist. That is numeric
    data BTW.

    Any help or pointers appreciated.

    Dennis

    Dennis G. Wicks Guest

  9. #8

    Default Re: Need help sorting by specific fields in file.

    At 01:49 PM 2/2/04 -0600, Dennis G. Wicks wrote:
    >I have a file that I need to sort and currently I am just
    >sorting it by
    >
    > @datalist = sort(@datalist);
    >
    >but it will eventually have many more records and many of
    >them may be quite large, but I only need to sort on the
    >first six characters which would be faster. Wouldn't it?
    >
    >I have looked at perldoc and it shows things like
    >
    > @articles = sort {$a <=> $b} @files;
    >
    >but I can't figure out how to tell the sort that $a and $b
    >are the first six characters of @datalist. That is numeric
    >data BTW.
    You start by assuming that $a will refer to one item from list of things
    being sorted, and that $b will refer to another item that $a is being
    sorted against. That's what Perl takes it to mean when you refer to $a and
    $b in a sort function call.

    To tell Perl to sort on the first 6 chars of the two things being compared,
    then do it like this:

    @articles = sort { substr($a,0,6) cmp substr($b,0,6) } @datalist;

    Note that we're using the string-specific operator 'cmp' rather than the
    numeric operator <=> because we are comparing strings (the results of
    substr) rather than the original numbers. (This code assumes each number
    in your list is at least 6 characters long. If not, you may have a couple
    extra hoops to jump through.)

    The general form of the sort function call is

    sort SUBNAME LIST
    sort BLOCK LIST
    sort LIST

    and the BLOCK or SUBNAME part of the sort call tells Perl how to decide
    whether, when comparing each pair of things from the list, the first one is
    less than, equal to, or greater than the second one. For each pair, Perl
    executes the given BLOCK or SUBNAME, substituting actual values for $a and
    $b to decide which one comes out on top.

    HTH.

    Michael C. Davis Guest

  10. #9

    Default Re: Need help sorting by specific fields in file.

    Dennis,
    Not to tell you how to run your business, but how is the date formatted in
    the array?
    It has been my experience in working with dates that they should be
    formatted as 20040202. This allows you to sort on years that are different.
    Eric
    ----- Original Message -----
    From: "Dennis G. Wicks" <wix@eskimo.com>
    To: <beginners@perl.org>
    Sent: Monday, February 02, 2004 1:49 PM
    Subject: Need help sorting by specific fields in file.

    > Greetings;
    >
    > I have a file that I need to sort and currently I am just
    > sorting it by
    >
    > @datalist = sort(@datalist);
    >
    > but it will eventually have many more records and many of
    > them may be quite large, but I only need to sort on the
    > first six characters which would be faster. Wouldn't it?
    >
    > I have looked at perldoc and it shows things like
    >
    > @articles = sort {$a <=> $b} @files;
    >
    > but I can't figure out how to tell the sort that $a and $b
    > are the first six characters of @datalist. That is numeric
    > data BTW.
    >
    > Any help or pointers appreciated.
    >
    > Dennis
    >
    >
    > --
    > To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    > For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>
    >
    >
    Eric Edwards Guest

  11. #10

    Default Re: Need help sorting by specific fields in file.

    On Feb 2, 2004, at 1:49 PM, Dennis G. Wicks wrote:
    > Greetings;
    >
    > I have a file that I need to sort and currently I am just
    > sorting it by
    >
    > @datalist = sort(@datalist);
    Okay, but you're not sorting a file there. You're sorting an array.
    Maybe that array was loaded from a file, but we're dealing with in
    memory arrays now.

    You mention below that this is numeric data, so that should be:

    @datalist = sort { $a <=> $b } @datalist;
    > but it will eventually have many more records and many of
    > them may be quite large, but I only need to sort on the
    > first six characters which would be faster. Wouldn't it?
    Honestly, I don't know, but I suspect that it wouldn't. I could be
    wrong. You could benchmark to find out. Thing is, first you have to
    grab the first 6 characters off of all of them, that takes time.
    You're also assuming that the default comparison, whatever it is, is
    comparing every single character. I would hope it sort circuits as
    soon as it has enough information to compare things. If it does, you
    might slow it down, instead of speed it up.

    More importantly, this is a problem to consider AFTER it becomes slow.
    You say it's fast now. Great. Don't touch it. Computers can handle a
    lot of information very fast these days and humans who spend time
    coding a "faster" solution for something that was already happening in
    the blink of an eye are silly.

    My worry, just from reading your message, was: Is the dataset too big
    to be placed into a single array in memory, as it seems you are doing?
    > I have looked at perldoc and it shows things like
    >
    > @articles = sort {$a <=> $b} @files;
    >
    > but I can't figure out how to tell the sort that $a and $b
    > are the first six characters of @datalist. That is numeric
    > data BTW.
    >
    > Any help or pointers appreciated.
    @dataset = sort { substr($a, 0, 6) <=> substr($b, 0, 6) } @dataset;

    That's just a basic grab the first 6 numbers and compare approach. For
    big data sets though, we can possibly get faster:

    @dataset =
    map { $$_[1] }
    sort { $$a[0] <=> $$b[0] }
    map { [ substr($_, 0, 6), $_ ] } @dataset;

    That's a little trickier. First, we build a list of all the sub
    strings, then we compare, then we restore the original, but now sorted
    list. Usually, this is faster, if a sort has complex transformations
    needed to compare data and the list is big. However, I'm not sure how
    much faster a dereference for those array refs I used is going to be
    over a substr() call.

    Again, you would have to benchmark to see if we're making any
    meaningful gains here, which I'm doubtful of. Perl includes a standard
    Benchmark module for this.

    I hope that helps.

    James

    James Edward Gray II Guest

  12. #11

    Default Re: Need help sorting by specific fields in file.

    "Dennis G. Wicks" wrote:
    > Greetings;
    >
    > I have a file that I need to sort and currently I am just
    > sorting it by
    >
    > @datalist = sort(@datalist);
    Try this:
    > @articles = sort {substr($a, 6) + 0 <=> substr($b, 6) + 0}
    > @files;
    >
    > but I can't figure out how to tell the sort that $a and $b
    > are the first six characters of @datalist. That is numeric
    > data BTW.
    Joseph

    R. Joseph Newton Guest

  13. #12

    Default Re: Need help sorting by specific fields in file.

    "R. Joseph Newton" wrote:

    Correction inline. Forgot the start param for substr()
    > "Dennis G. Wicks" wrote:
    >
    > > Greetings;
    > >
    > > I have a file that I need to sort and currently I am just
    > > sorting it by
    > >
    > > @datalist = sort(@datalist);
    >
    > Try this:
    >
    > > @articles = sort {substr($a, 0, 6) + 0 <=> substr($b, 0, 6)
    > + 0}
    > > @files;
    > >
    > > but I can't figure out how to tell the sort that $a and $b
    > > are the first six characters of @datalist. That is numeric
    > > data BTW.
    >
    > Joseph
    >
    > --
    > To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    > For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>
    R. Joseph Newton Guest

  14. #13

    Default Re: Need help sorting by specific fields in file.

    R. Joseph Newton wrote:
    >
    > "Dennis G. Wicks" wrote:
    >
    > > Greetings;
    > >
    > > I have a file that I need to sort and currently I am just
    > > sorting it by
    > >
    > > @datalist = sort(@datalist);
    >
    > Try this:
    >
    > > @articles = sort {substr($a, 6) + 0 <=> substr($b, 6) + 0}
    > > @files;
    > >
    > > but I can't figure out how to tell the sort that $a and $b
    > > are the first six characters of @datalist. That is numeric
    > > data BTW.
    Hi Joseph.

    That's

    substr STRING, OFFSET, LENGTH

    also the TIE-fighter will force it's parameters to numeric,
    so there's no need to add zero.

    so it'll be:

    sort {substr($a, 0, 6) <=> substr($b, 0, 6)} @files;

    Rob


    Rob Dixon Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139