perl and PostgreSQL?

2005-02-01 Thread Mariano Cunietti
Hi, can anybody address me to online resources to learn how to connect to a PostgreSQL DB server through a Perl script? Code examples are welcome ;-) TIA Mariano - Mariano Cunietti System Administrator Enter S.r.l. Via Stefanardo da Vimercate, 28 20128 - Milano -

Re: perl and PostgreSQL?

2005-02-01 Thread Remo Sanges
On Feb 1, 2005, at 11:21 AM, Mariano Cunietti wrote: Hi, can anybody address me to online resources to learn how to connect to a PostgreSQL DB server through a Perl script? http://www.perl.com/pub/a/1999/10/DBI.html http://search.cpan.org/~timb/DBI/DBI.pm

Different key in 2 hashes

2005-02-01 Thread Mark Martin
Hi, okay - straight out of the coobook : my @different = () foreach (keys %hash1) { delete $hash1{$_} unless exists $hash2$_}; push(@this_not_that,$_) unless exists $registered{$_}; } easy to remove the different key from hash one and record the removed item in @different. My question is

Re: Different key in 2 hashes

2005-02-01 Thread Remo Sanges
On Feb 1, 2005, at 1:53 PM, Mark Martin wrote: Hi, okay - straight out of the coobook : my @different = () foreach (keys %hash1) { delete $hash1{$_} unless exists $hash2$_}; push(@this_not_that,$_) unless exists $registered{$_}; } easy to remove the different key from hash one and record the

RE: Different key in 2 hashes

2005-02-01 Thread Bob Showalter
Mark Martin wrote: Hi, okay - straight out of the coobook : my @different = () foreach (keys %hash1) { delete $hash1{$_} unless exists $hash2$_}; push(@this_not_that,$_) unless exists $registered{$_}; } easy to remove the different key from hash one and record the removed item

Compile perl code/files via STDIN

2005-02-01 Thread Michael Seele
hi, i want to open a perl process and enter the code/files to compile via STDIN. i know it is possible. but how? does somebody know a tutorial or something like this which explains how i can compile perl code via STDIN? thx mseele -- G H Softwareentwicklung GmbH Tel.: +49(0)7451/53706-20

rmdir

2005-02-01 Thread dsimmons
I want to delete the files from a directory then delete the directory. I have code which processes a file containing a list of files, one per line. That routine creates a subdirectory based on the file name and then writes files to the subdirectory. I have the following code to process the

Re: rmdir

2005-02-01 Thread Ing. Branislav Gerzo
[EMAIL PROTECTED] [d], on Tuesday, February 1, 2005 at 09:58 (-0500) thinks about: d I want to delete the files from a directory then delete the directory. use File::Path; $remove = 'C:\temp'; rmtree($remove) if -e $remove; more @ http://search.cpan.org/~nwclark/perl-5.8.6/lib/File/Path.pm --

Re: rmdir

2005-02-01 Thread Mariano Cunietti
Hi, I was wondering if there is anybody who can show me the *correct* way to use a fast pattern-search-and-assign. I mean: I am extracting viertual aliases from a postfix config file: # cannot use 'split' function, some statements in the second field may contain whitespaces (e.g. ERROR blah

RE: Different key in 2 hashes

2005-02-01 Thread Mark Martin
Thank you - worked a treat. At 09:00 01/02/2005 -0500, Bob Showalter wrote: Mark Martin wrote: Hi, okay - straight out of the coobook : my @different = () foreach (keys %hash1) { delete $hash1{$_} unless exists $hash2$_}; push(@this_not_that,$_) unless exists $registered{$_}; }

Re: rmdir

2005-02-01 Thread Ing. Branislav Gerzo
Mariano Cunietti [MC], on Tuesday, February 01, 2005 at 16:19 (+0100) typed: MC I was wondering if there is anybody who can show me the *correct* way to MC use a fast pattern-search-and-assign. MC I mean: I am extracting viertual aliases from a postfix config file: 1. you did not change subject

assigning values from a regexp

2005-02-01 Thread Mariano Cunietti
On Tue, 2005-02-01 at 16:33, Ing. Branislav Gerzo wrote: Mariano Cunietti [MC], on Tuesday, February 01, 2005 at 16:19 (+0100) typed: MC I was wondering if there is anybody who can show me the *correct* way to MC use a fast pattern-search-and-assign. MC I mean: I am extracting viertual

Re: assigning values from a regexp

2005-02-01 Thread Ing. Branislav Gerzo
Mariano Cunietti [MC], on Tuesday, February 01, 2005 at 16:44 (+0100) thinks about: MC my ($virtual, $address) = ($_ =~ /^([^\s]+) (.*)$/); maybe this helps you: my ($virtual, $adress) = /^([^\s]+)\s+(.*)$/; -- ...m8s, cu l8r, Brano. [That damnabley kind of you, Mr. Mallory! Arturo] --

Re: Compile perl code/files via STDIN

2005-02-01 Thread JupiterHost.Net
Michael Seele wrote: hi, Hello, i want to open a perl process and enter the code/files to compile via STDIN. i know it is possible. but how? does somebody know a tutorial or something like this which explains how i can compile perl code via STDIN? Do you mean: perl -e 'print Hi\n;' perl

Similar C++ digest?

2005-02-01 Thread Christopher Spears
This digest has really helped me learn Perl, so I was wondering if there is a similar digest for beginning C++ programmers. -Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: perl and PostgreSQL?

2005-02-01 Thread Lawrence Statton
Hi, can anybody address me to online resources to learn how to connect to a PostgreSQL DB server through a Perl script? Code examples are welcome ;-) TIA - begin perl code --- #!/usr/bin/perl use strict; use warnings; use DBI; our $_dbh;

Re: Compile perl code/files via STDIN

2005-02-01 Thread Dave Gray
i want to open a perl process and enter the code/files to compile via STDIN. i know it is possible. but how? does somebody know a tutorial or something like this which explains how i can compile perl code via STDIN? $ perl print Hello from STDIN\n; ^D Hello from STDIN $ If the answers so

Re: perl and PostgreSQL?

2005-02-01 Thread Eduardo Vázquez Rodríguez
Did you have already check the compile process of the Perl Module that provides access to Postgres? If you have do it. Then my code might help you use DBI; use diagnostics; use strict; my $database=Database; my $username=postgres; my $password=123; my ($mbd, $sth1); $mbd =

Ref and deref of hash

2005-02-01 Thread Jerry Preston
I have a .pm file that calls sub a that calls sub b. Sub B returns %data to sub a in the form %a_data = sub a; I am trying to return \%a_data to the original program that call sub a. $results = $data-a; sub a { %b_data = b; # data good! return

RE: Ref and deref of hash

2005-02-01 Thread Jerry Preston
GOT IT! Jerry -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 02, 2005 12:14 AM To: 'Perl Beginners' Subject: Ref and deref of hash I have a .pm file that calls sub a that calls sub b. Sub B returns %data to sub a in the form %a_data = sub