Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: DBD::CSV - how to install? (FTP only)

by lwicks (Friar)
on Dec 14, 2003 at 10:40 UTC ( [id://314620]=note: print w/replies, xml ) Need Help??


in reply to Re: DBD::CSV - how to install? (FTP only)
in thread DBD::CSV - how to install? (FTP only)

Many thanks for the replies, I shall have a shot with AnyData.

Sadly never used it, so is anyone here able to help me through the process of installing via FTP and getting it working.?

---

Kia Kaha, Kia Toa, Kia Manawanui!
Be Strong, Be Brave, Be perservering!
  • Comment on Re: Re: DBD::CSV - how to install? (FTP only)

Replies are listed 'Best First'.
Re: Re: Re: DBD::CSV - how to install? (FTP only)
by strat (Canon) on Dec 14, 2003 at 13:27 UTC

    For the installation:

    1. download the module from CPAN

    2. have a look at the included Makefile.PL for module dependencies (they are in the hashReference with the key PREREQ_PM in the form Modulename => version, and have a look if these prerequisites are installed. If no, start over with that module and so on. If yes, continue with the next step

    3. upload the module via FTP and unpack it to a temporary directory

    4. If you've got acces to a make, you can install the module to your own directory by calling

    perl Makefile.PL PREFIX=/path/to/your/private/modulelib make make test make install

    5. If you have to install more modules, set the environmentvariable PERL5LIB to your /path/to/your/private/modulelib, e.g. in bash: export PERL5LIB=/path/to/your/private/modulelib and start over with step 3.

    6. use your module-lib from your perl-scripts with use lib qw(/path/to/your/private/modulelib/) or the like (sometimes the StandardModule Findbin might also be interesting for you)

    If you don't have access to make, you could try to copy the files to your directories, but that will only work if they are pure perl-modules. If not, you could try to set up a system as similar as your webserver and compile it there, but it is very difficult to get a nearly identical environment; there you better look around for other (already installed) modules that can do the job of persistance, too (e.g. DB_File, Tie::File, ...) or rely on Data::Dumper for persistance. You could also rely to Storable with is a very fast and compact solution, but if this module is updated, it sometimes can't read the data from it's older version

    BTW: if you don't have shell access like telnet or ssh, you could also fire these commands by a cgi-script (or write it to a bash-script and execute it from your cgi. But better care for errors and failure or you will get troubles when using these modules

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Re: Re: Re: DBD::CSV - how to install? (FTP only)
by jZed (Prior) on Dec 14, 2003 at 20:18 UTC
    I've packed everything you'll need for DBD::AnyData (except DBI) into AnyData-Standalone It will allow you to install all of the pre-required modules (all maintained by me, BTW) with only FTP access. Here's the README for AnyData-Standalone:
    AnyData::Standalone -- install AnyData without make or compile
    
    WHAT IT IS (AND ISN'T)
    
     This package includes all of the files needed to install AnyData
     and DBD::AnyData.  It is *only* for extreme cases where you can't
     use CPAN or PPM or manual install (for example if you only have
     FTP access to a server or you are installing onto a PDA or other
     limited environment).  If you are using this package to avoid
     learning how to install modules, please don't do that.  Learn to
     install modules, it will really, really help you in the long run.
    
    HOW TO INSTALL
    
     Unpack this package in the desired location (or unpack it locally and
     then FTP the resulting MyLib directory to the final location).  In
     scripts that call the modules put this at the top:
    
         use lib 'path/MyLib';   # path = wherever you unpacked MyLib
    
     This package does not include DBI.  If you want to use DBD::AnyData,
     you'll need to install DBI separately.  DBI also has a Pure Perl
     version that can be installed without compile or make, see the DBI
     and DBI::PurePerl docs for further info.
    
    WHAT VERSIONS ARE INCLUDED
    
         AnyData        0.08
         DBD::AnyData   0.06
         DBD::File      0.22
         SQL::Statement 1.005
    
    =head1 DOCUMENTATION
     
     The documentation for each module is included with the module, use
     perldoc <module_name> or just read the pod section in a text viewer
     or look up the docs online at http://search.cpan.org/~jzucker/.
    
      Hi again,
      still struggling here, would appreciate it if someone could help me with the below code which fails.

      The below code fails on the line:
      $dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog');

      Cheers!

      -----------------

      #!/usr/bin/perl -w use strict; require 'html.pl'; use lib './MyLib'; use DBI; my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog'); my $sth = $dbh->prepare("SELECT surname FROM users"); $sth->execute(); while (my $row = $sth->fetch) { print "@$row\n"; } # define variables header(); print("<table width='90%'>"); print("<TR valign='top'><TD width='30%'>"); print ("Menu<BR>"); print ("====<BR>"); print ("<a href='create-user.cgi'>Create New User</a><BR>"); print ("Login User<BR>"); print ("User Admin<BR>"); print("</TD>"); print("<TD>"); print ("CREATE USER<BR>"); print ("==========<BR>"); print ("This is where the code to create new users will be place +d"); print ("<P>"); print ("USER VARIABLES<HR>"); my %user_data = qw( id blank first_name blank surname blank date_of_birth blank email blank password blank active blank last_login blank create_date blank earnings blank cash blank judoka_limit blank sensei_limit blank dojo_limit blank team_limit blank rank blank ); open (OUTFILE, ">./user_data/test_user"); while (($a, $b) = each(%user_data)){ print ("Key = $a and its value is $b<BR>"); print OUTFILE ("$a\n$b"); } close (OUTFILE); print ("<HR>USERS ON SYSTEM<HR>"); opendir(USERS, "./user_data"); while ( my $name = readdir(USERS)) { if ($name ne '.' and $name ne '..') { print ("<a href='./user_data/$name'>$n +ame</a><BR>"); } } closedir(USERS); print("</TR>"); print("</table>");
      Kia Kaha, Kia Toa, Kia Manawanui!
      Be Strong, Be Brave, Be perservering!

        The below code fails on the line: $dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog');

        What is the error or warning message you get?

        Update oh never mind, I just spotted it (although in the future please always show the error message rather than just saying "it failed"). The problem here is that you don't have a comma between 'users.csv' and 'ad_catalog'. If you copied that from the docs and the docs look like that, please let me know where so I can fix it :-).
      FANTASTIC!!

      Sir, you are a scholar and a gentleman!

      ---
      Kia Kaha, Kia Toa, Kia Manawanui!
      Be Strong, Be Brave, Be perservering!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://314620]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found