Loading ...
Sorry, an error occurred while loading the content.
 

RE: [PBML] Still not clear

Expand Messages
  • Charles K. Clarkson
    ... Alright, let s work from an example: print_date( Thursday , August ); print_date( Friday , August ); print_date( Wednesday , Spring ); sub
    Message 1 of 12 , Aug 30 11:30 AM
      Krishnakant [mailto:perlpro@...] wrote:
      :
      : Hi again,
      : I am stil confused, I dont understand why will the @_ arey
      : take the values from left to right. I mean what is the
      : meaning of the following statement. my($var1, $var2, $var3) =
      : @_; how does the @_ take the list from the left when the =
      : opperater takes the value from the right and passes it to the
      : opprant at the left?

      Alright, let's work from an example:

      print_date( 'Thursday', 'August' );
      print_date( 'Friday', 'August' );
      print_date( 'Wednesday', 'Spring' );

      sub print_date {

      my ( $day, $month ) = @_;

      print "One $day in $month\n";

      }

      In the background, perl places 'Thursday'
      and 'August' in @_ the first time print_date is
      called.

      The second time print_date is called perl
      puts 'Friday' and 'August' in @_ in the
      background.

      The third time perl puts 'Wednesday' and
      'Spring' in @_ in the background.


      Does that make it a little more clear?

      Charles K. Clarkson
      --
      Head Bottle Washer,
      Clarkson Energy Homes, Inc.
      Small commercial and residential rehabilitation specialists.
      254 968-8328

      CJ Web Work - Solutions for Real Estate Investors.
      972 216-4952

      CJ Web Hosting - Lookout; We have one whole paying customer!
      254 968-8328
    • Krishnakant
      Hi again, I am stil confused, I dont understand why will the @_ arey take the values from left to right. I mean what is the meaning of the following
      Message 2 of 12 , Aug 30 11:42 AM
        Hi again,
        I am stil confused, I dont understand why will the @_ arey take the values from left to right. I mean what is the meaning of the following statement.
        my($var1, $var2, $var3) = @_;
        how does the @_ take the list from the left when the = opperater takes the value from the right and passes it to the opprant at the left?
        -------------------------------------------------
        Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
        Know more at http://mail.sify.com

        Want to get into IIM? Take the Sify Mock CAT now!
        http://education.sify.com/mockcat
      • Krishnakant
        hello all, Thanks for your help. I now got it right. I know I should have thanked my friends in private and not on the list. But I am intentionally doing
        Message 3 of 12 , Aug 30 9:54 PM
          hello all,
          Thanks for your help. I now got it right. I know I should have thanked my friends in private and not on the list. But I am intentionally doing this so others dont take out their valuable time to explain what I have already understood.
          Thanks again.
          Krishnakant mane
          Chairman, Compact Software Solutions.
          -------------------------------------------------
          Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
          Know more at http://mail.sify.com

          Want to get into IIM? Take the Sify Mock CAT now!
          http://education.sify.com/mockcat
        • Franki
          Hi guys, I was asked recently if I could make a small perl web interface for a database, when I asked what type of database it was I was told its Universe . I
          Message 4 of 12 , Aug 31 1:48 AM
            Hi guys,

            I was asked recently if I could make a small perl web interface for a
            database,

            when I asked what type of database it was I was told its "Universe".
            I have heard about it, but have no idea of any specifics.

            Has anyone here had any experiance with universe? can it be accessed
            remotely with perl???

            I just want to do some basic queries and display the results.

            Is it doable? any tips? any modules I should be looking at?
            I did a search on cpan and didn't see anything related.

            Any info would be great. meanwhile, I'll continue searching the web.

            Thankyou,

            rgds

            Frank
          • Franki
            Dunno if anyone is interested, but in case someone ever has the same question, I ll answer it here so it can be in the archives. Universe, from what I can tell
            Message 5 of 12 , Sep 1, 2002
              Dunno if anyone is interested, but in case someone ever has the same
              question, I'll answer it here so it can be in the archives.

              Universe, from what I can tell is an IBM database that was originally
              created by a company called "informix".

              After much searching and nashing of teeth, I discovered that there is an
              informix db driver for informix that will allow me to use standard DBI
              methods and such..

              I have yet to find out what specifics I will lose by using DBI (since
              universe is predominantly NOT an SQL DB, though it has a SQL addon.) but its
              better then using system calls or something or using their native C or Java
              interfaces.

              I couldn't believe that IBM make no refference to DBI at all, they support
              JAVA and C, and even COBOL, but not perl..(even though someone else did the
              work for them.) I guess they figure universe is for large enterprise and
              that large enterprise don't use perl for anything more then basic system
              stuff.

              So if anyone else ever asks about universe DB, tell them to look for
              informix.


              thanks


              Frank

              -----Original Message-----
              From: Franki [mailto:frankieh@...]
              Sent: Saturday, 31 August 2002 4:48 PM
              To: perl-beginner@yahoogroups.com
              Subject: [PBML] universe database and perl.


              Hi guys,

              I was asked recently if I could make a small perl web interface for a
              database,

              when I asked what type of database it was I was told its "Universe".
              I have heard about it, but have no idea of any specifics.

              Has anyone here had any experiance with universe? can it be accessed
              remotely with perl???

              I just want to do some basic queries and display the results.

              Is it doable? any tips? any modules I should be looking at?
              I did a search on cpan and didn't see anything related.

              Any info would be great. meanwhile, I'll continue searching the web.

              Thankyou,

              rgds

              Frank



              Unsubscribing info is here:
              http://help.yahoo.com/help/us/groups/groups-32.html

              Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            • Jason Waugh
              Hi Franki, F I have yet to find out what specifics I will lose by using DBI (since F universe is predominantly NOT an SQL DB, though it has a SQL addon.) but
              Message 6 of 12 , Sep 1, 2002
                Hi Franki,

                F> I have yet to find out what specifics I will lose by using DBI (since
                F> universe is predominantly NOT an SQL DB, though it has a SQL addon.) but its
                F> better then using system calls or something or using their native C or Java
                F> interfaces.

                UniVerse is fully ANSI SQL compliant, so there should be no problem
                there. As well, there is an ODBC driver for the database if one must
                choose that route.

                UniVerse is a brand new product for IBM - only a matter of time before
                there is a DBD::UniVerse, I'm sure (perhaps just rename the Informix
                one?)

                F> I couldn't believe that IBM make no refference to DBI at all, they support
                F> JAVA and C, and even COBOL, but not perl..(even though someone else did the
                F> work for them.) I guess they figure universe is for large enterprise and
                F> that large enterprise don't use perl for anything more then basic system
                F> stuff.

                IBM makes lots of reference to Perl at their site. In fact, they tell
                you how to use the DBI to access their main database product - DB2
                Universal Database - here: http://www-3.ibm.com/software/data/db2/perl/


                --
                Regards,
                Jason Waugh
              • Venkata Suresh Babu (STP)
                Hi Jason Waugh, I would like to know the same regarding the sybase database is there any package/module/library is currently avalible for dbd and dbi.. adivse
                Message 7 of 12 , Sep 1, 2002
                  Hi Jason Waugh,
                  I would like to know the same regarding the sybase database
                  is there any package/module/library is currently avalible for dbd and dbi..
                  adivse me on that
                  cheers
                  venkat

                  -----Original Message-----
                  From: Jason Waugh [mailto:jwaugh26@...]
                  Sent: Monday, September 02, 2002 10:27 AM
                  To: Franki
                  Subject: Re: [PBML] universe database and perl.


                  Hi Franki,

                  F> I have yet to find out what specifics I will lose by using DBI (since
                  F> universe is predominantly NOT an SQL DB, though it has a SQL addon.) but
                  its
                  F> better then using system calls or something or using their native C or
                  Java
                  F> interfaces.

                  UniVerse is fully ANSI SQL compliant, so there should be no problem
                  there. As well, there is an ODBC driver for the database if one must
                  choose that route.

                  UniVerse is a brand new product for IBM - only a matter of time before
                  there is a DBD::UniVerse, I'm sure (perhaps just rename the Informix
                  one?)

                  F> I couldn't believe that IBM make no refference to DBI at all, they
                  support
                  F> JAVA and C, and even COBOL, but not perl..(even though someone else did
                  the
                  F> work for them.) I guess they figure universe is for large enterprise and
                  F> that large enterprise don't use perl for anything more then basic system
                  F> stuff.

                  IBM makes lots of reference to Perl at their site. In fact, they tell
                  you how to use the DBI to access their main database product - DB2
                  Universal Database - here: http://www-3.ibm.com/software/data/db2/perl/


                  --
                  Regards,
                  Jason Waugh



                  Unsubscribing info is here:
                  http://help.yahoo.com/help/us/groups/groups-32.html

                  Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                • Jason Waugh
                  Hi Venkata, VSBS I would like to know the same regarding the sybase database VSBS is there any package/module/library is currently avalible for dbd and dbi..
                  Message 8 of 12 , Sep 1, 2002
                    Hi Venkata,

                    VSBS> I would like to know the same regarding the sybase database
                    VSBS> is there any package/module/library is currently avalible for dbd and dbi..
                    VSBS> adivse me on that


                    Try http://search.cpan.org and search for (oddly enough) Sybase.

                    --
                    Regards,
                    Jason Waugh
                  • Krishnakant
                    Hello, I am back to bother you all again. I need to develop a database based web site with perl cgi. I know quite a bit of cgi but I dont know much about
                    Message 9 of 12 , Sep 2, 2002
                      Hello,
                      I am back to bother you all again. I need to develop a database based web site with perl cgi. I know quite a bit of cgi but I dont know much about perl and dbi. I want to know firstly how do I connect to a database under windows platform. And if odbc is the answer can I use odbc under linux as well?
                      What amount of expertise I need to do database programming with perl. Do I need to be an expert in things like references and hashes. I am quite good at hashes but I only used pointers in c and c++.
                      Secondly please help me out with step by step procedure to connect to an access .mdb database with perl. Again if it can be done through odbc then I suppose I can also build a connection to mysql and oracle as well! And lastly I want to know as to how I open record sets and move to the next,previous,first and last record of data in the dataset or record set.
                      Thanks,
                      Krishnakant.
                      -------------------------------------------------
                      Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
                      Know more at http://mail.sify.com

                      Want to get into IIM? Take the Sify Mock CAT now!
                      http://education.sify.com/mockcat
                    • krishnakumarjayaraman
                      ... dbd and dbi.. ... Have you looked at SYBPERL from michael peppler ?
                      Message 10 of 12 , Sep 2, 2002
                        --- In perl-beginner@y..., Jason Waugh <jwaugh26@r...> wrote:
                        > Hi Venkata,
                        >
                        > VSBS> I would like to know the same regarding the sybase database
                        > VSBS> is there any package/module/library is currently avalible for
                        dbd and dbi..
                        > VSBS> adivse me on that
                        >
                        >
                        Have you looked at SYBPERL from michael peppler ?
                      • Gordon Stewart
                        Hi - I ve got a WORKING script .. Ive transferred/copid it over to a new directory (for testing/modifying) I have NOT altered this section / sub - However I m
                        Message 11 of 12 , Sep 3, 2002
                          Hi - I've got a WORKING script .. Ive transferred/copid it over to a new
                          directory (for testing/modifying)

                          I have NOT altered this section / sub - However I'm getting this error
                          message :-

                          --------------------
                          Can't localize lexical variable @rawCookies at
                          /www/g/gorstew/cgi-bin/test1/view.cgi line 1070.
                          --------------------

                          The sub is one that is used by some other systems - a known (sort of) script :-

                          sub getCookies {
                          # cookies are seperated by a semicolon and a space, this will split
                          # them and return a hash of cookies
                          local(@rawCookies) = split (/; /,$ENV{'HTTP_COOKIE'});
                          local(%cookies);

                          foreach(@rawCookies){
                          ($key, $val) = split (/=/,$_);
                          $cookies{$key} = $val;
                          }

                          return %cookies;
                          }


                          anyway the trouble is with the 'local' parts - Which work on my other script.

                          any ideas on how to localise / Fix this - I cant remember what that term means


                          G.

                          ----------


                          ---
                          Outgoing mail is certified Virus Free.
                          Checked by AVG anti-virus system (http://www.grisoft.com).
                          Version: 6.0.384 / Virus Database: 216 - Release Date: 21/08/02


                          [Non-text portions of this message have been removed]
                        • Jeff 'japhy' Pinyan
                          ... That means that somewhere else in the code, you have my @rawCookies which makes @rawCookies a LEXICAL variable. Because it s lexical, you can t
                          Message 12 of 12 , Sep 3, 2002
                            On Sep 4, Gordon Stewart said:

                            >--------------------
                            >Can't localize lexical variable @rawCookies at
                            >/www/g/gorstew/cgi-bin/test1/view.cgi line 1070.
                            >--------------------

                            That means that somewhere else in the code, you have

                            my @rawCookies

                            which makes @rawCookies a LEXICAL variable. Because it's lexical, you
                            can't local()-ize it.

                            But you shouldn't be using local(). Change your local()s to my()s. There
                            are only a few instances where local() is important, and you'll probably
                            never run into them.

                            >sub getCookies {
                            > # cookies are seperated by a semicolon and a space, this will split
                            > # them and return a hash of cookies
                            > local(@rawCookies) = split (/; /,$ENV{'HTTP_COOKIE'});
                            > local(%cookies);
                            >
                            > foreach(@rawCookies){
                            > ($key, $val) = split (/=/,$_);
                            > $cookies{$key} = $val;
                            > }
                            >
                            > return %cookies;
                            >}

                            You might want to consider using a module such as CGI::Cookie to work with
                            cookies.

                            --
                            Jeff "japhy" Pinyan japhy@... http://www.pobox.com/~japhy/
                            RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
                            ** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
                            <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
                            [ I'm looking for programming work. If you like my work, let me know. ]
                          Your message has been successfully submitted and would be delivered to recipients shortly.