variable problems

2002-10-14 Thread pike
hi folks, i got a little problem with pasting variables into my modul funktion it simple looks like this ... ## my $update = Net::DNS::Update->new($vars{zone}); my $res = Net::DNS::Resolver->new; my $nameserver1 = $vars{server};

Re: variable problems

2002-10-14 Thread Frank Wiles
.--[ pike wrote (2002/10/14 at 14:17:46) ]-- | | hi folks, | | i got a little problem with pasting variables into my modul funktion it | simple looks like this ... | | ## | my $update = Net::DNS::Update->new($vars{zone}); |

Re: variable problems

2002-10-14 Thread pike
Am Montag, 14. Oktober 2002 15:11 schrieben Sie: > .--[ pike wrote (2002/10/14 at 14:17:46) ]-- > > | hi folks, > | > | i got a little problem with pasting variables into my modul funktion it > | simple looks like this ... > | > | ## >

How can I evaluate within a string

2002-10-14 Thread Ramprasad A Padmanabhan
Dear all, Is there a way I can write print "Number of records = ++$records in the db\n"; instead of print "Number of records = " . ++$records . "in the db\n"; Thanks Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: How can I evaluate within a string

2002-10-14 Thread James Edward Gray II
On Monday, October 14, 2002, at 09:06 AM, Ramprasad A Padmanabhan wrote: > Dear all, > >Is there a way I can write >print "Number of records = ++$records in the db\n"; > instead of > print "Number of records = " . ++$records . "in the > db\n"; print "Nu

Re: How can I evaluate within a string

2002-10-14 Thread Jeff 'japhy' Pinyan
On Oct 14, Ramprasad A Padmanabhan said: >Is there a way I can write >print "Number of records = ++$records in the db\n"; Well, you can use the @{[ ... ]} trick: print "2 + 3 = @{[ 2 + 3 ]}\n"; or you can use the Interpolate module (found on CPAN), which allows you to use

Re: How can I evaluate within a string

2002-10-14 Thread Paul Johnson
On Mon, Oct 14, 2002 at 09:10:56AM -0500, James Edward Gray II wrote: > On Monday, October 14, 2002, at 09:06 AM, Ramprasad A Padmanabhan > wrote: > > >Dear all, > > > > Is there a way I can write > > print "Number of records = ++$records in the db\n"; > >instead of > >

Re: help with pipes

2002-10-14 Thread zentara
On Sun, 13 Oct 2002 10:30:06 -0400, [EMAIL PROTECTED] (David Gerler) wrote: >I have successfully piped a print statement to gpg. My problem is >coming in >when I try to get it back out via a pipe. Can anyone tell me, is it >possible >to send data to a another program and the output back with out

Creating string on the fly

2002-10-14 Thread Vincent Lee
Can someone help me with some basic logic? I have an array with unique tablenames from a DB catalog view TABNAME --- Org Employee Dept Each of these tablenames has columns in a hash array For example, ORG would have 3 columns and the array would be as follows: ORG ID ORG COL1 ORG COL2

another regexp question

2002-10-14 Thread Duarte Cordeiro
Hi, Background: I have a @filelist that can have (guess what) several filenames. I want to split the filenames in 3 arrays: - if the file is in a directory *\templatedata\*\data\ it should go to array1; - if the file is in a directory \binaries\* it should go to array2; - any other file shou

Re: another regexp question

2002-10-14 Thread Frank Wiles
.--[ Duarte Cordeiro wrote (2002/10/14 at 16:42:35) ]-- | | Hi, | | Background: | I have a @filelist that can have (guess what) several filenames. | I want to split the filenames in 3 arrays: | - if the file is in a directory *\templatedata\*\data\ it should go | t

Weekly posting statistics 41/2002

2002-10-14 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 41 of 2002. >From Monday 2002-10-07 to Sunday 2002-10-13 there were 454 articles posted (22004 lines) by 124 authors, giving an average 3.66 articles per author, and an average article length of 48 lpa. The average number of articles per day w

Re: another regexp question

2002-10-14 Thread John W. Krahn
Duarte Cordeiro wrote: > > Hi, Hello, > Background: > I have a @filelist that can have (guess what) several filenames. > I want to split the filenames in 3 arrays: > - if the file is in a directory *\templatedata\*\data\ it should go to array1; > - if the file is in a directory \binaries\* i

$! and close() (was Strange Errors)

2002-10-14 Thread James Edward Gray II
Hello again: Sorry to reply to my own message, but I know a little more now and could still use some clarification. Perl's $! variable is being set by a call to close(), I'm 99% sure. However, this call to close() does not return undef, it succeeds. The call is being made on a non blocking

Re: selective use of file content

2002-10-14 Thread Michael Fowler
On Sun, Oct 13, 2002 at 07:53:43PM -0500, Wiggins d'Anconia wrote: > You might also try putting package identifiers around the code in which > case when you use a package that has a different name space than the > package with the floaties they probably won't be executed, but this is > where I

Compiled scripts

2002-10-14 Thread Goodman Kristi - kgoodm
Why is it that some .pl scripts run fine but when you compile them, they do not run correctly. They compile fine, with no errors. Thanks, Kristi ** The information contained in this communication is confidential, is intended

Re: Strange Errors

2002-10-14 Thread Michael Fowler
On Sun, Oct 13, 2002 at 09:50:58PM -0500, James Edward Gray II wrote: > What's the best way to to track down the line that is setting the $! > variable? I can't quite figure out the rules of this guy. Once it's set, > what clears it? Its it localized to subroutines or packages or anything? > I

RE: Compiled scripts

2002-10-14 Thread Timothy Johnson
You'll defintely have to be more specific. Which scripts are not 'compiling'? What are you using to compile them? -Original Message- From: Goodman Kristi - kgoodm [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 12:28 PM To: '[EMAIL PROTECTED]' Subject: Compiled scripts Why

RE: Compiled scripts

2002-10-14 Thread Timothy Johnson
Hmm. I'm not familiar with 2.1. It might be worth your while to upgrade to 4.2, which I believe is the latest version. There have been some substantial improvements in the product since then. -Original Message- From: Goodman Kristi - kgoodm [mailto:[EMAIL PROTECTED]] Sent: Monday, O

Help with Hash Arrays

2002-10-14 Thread Vincent Lee
Can someone help me with this? I have a query in a database that queries the columns from the SYSCAT.COLUMNS table of either Oracle or DB2. I want to be able to print the columns in a string as follows: Col1, col2, col3...etc. depending on the table. How would I do this? = Regards, Vinc

Re: Strange Errors

2002-10-14 Thread James Edward Gray II
Thanks a million! You're totally right, it's just me miss using $!. I had just about figured all that out messing with it today, but I didn't understand the $! variable well enough. Thanks for explaining it to me. James On Monday, October 14, 2002, at 02:33 PM, Michael Fowler wrote: > On

Re: $! and close() (was Strange Errors)

2002-10-14 Thread Jeff 'japhy' Pinyan
On Oct 14, James Edward Gray II said: >Perl's $! variable is being set by a call to close(), I'm 99% sure. >However, this call to close() does not return undef, it succeeds. The Then close() isn't setting $! (to any meaningful value). Only use $! when something has failed. -- Jeff "japhy" Pi

Program stability issue. New Code..

2002-10-14 Thread Chris Benco
Change a lot of the program based on suggestions from people on this list, Thanks to all. Now I've found an unusual problem that doesn't exactly make sense. Have not done a lot of stress testing on this version yet, but found a way to make it fail that should not fail. What happens is that if it

RE: Compiled scripts

2002-10-14 Thread Goodman Kristi - kgoodm
Sorry... I am using PDK 2.1 to compile them. I have had a couple of scripts do this to me. They are totally different from one another. One is just querying a Access DB and printing out the information. Another one will not will not use the exit function, it is supposed to exit if it doesn't

POP3 account access

2002-10-14 Thread Jerry Preston
Hi! I am using the following code to try and access an existing POP3 account: #!/usr/local/bin/perl #=== # How to read email with Net::POP3 # Copyright 2000, Emmie P. Lewis # Created 02/27/00 #=== # This script is designed to show # how to

RE: POP3 account access

2002-10-14 Thread Jerry Preston
Hi! I see that the Sun NetMail is doing the following: Logging into IMAP server... Is this POP3? What should I use to access this? Thanks, Jerry -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:26 PM To: Beginners Perl Subject: POP3

Re: POP3 account access

2002-10-14 Thread John W. Krahn
Jerry Preston wrote: > > Hi! Hello, > I see that the Sun NetMail is doing the following: > > Logging into IMAP server... > > Is this POP3? No. > What should I use to access this? Net::IMAP http://search.cpan.org/author/DJKERNEN/Mail-IMAPClient-2.2.4/ John -- use Perl; program fulfillme

deleting spaces

2002-10-14 Thread learn perl
Hi guys, I have a simple question. Is there ways to get rid of any spaces within a variable? say the variable holds " R" or "R " or " R ". is there a function I could use for that? I tried chomp but it will only get rid of the last space but not the leading spaces. Thanks Eric -- To unsubs

RE: deleting spaces

2002-10-14 Thread Beau E. Cox
Hi - Use this simple regex: $var =~ s/ //g; or if your variable is in $_, just s/ //g; Aloha => Beau. -Original Message- From: learn perl [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:38 PM To: [EMAIL PROTECTED] Subject: deleting spaces Hi guys, I have a simple quest

RE: deleting spaces

2002-10-14 Thread Toby Stuart
$str = " a_ string "; $str =~ s/\s+//g; print $str; btw. chomp() removes the character defined by $/ (newline unless you change it) from the end of a string. chop() removes the last character from a string. > -Original Message- > From: learn perl [mailto:[EMAIL PROTECTED]] > Sent:

Re: Condition Evaluation

2002-10-14 Thread eric-perl
On Tue, 1 Oct 2002, Michael Fowler wrote: > While this works, typically the way I do it is something along the lines of: > > usage("Specify a directory to scan ...\n") unless defined $directory; > usage("Provide a comment for the ...\n") unless defined $comment; > > and so on, where us

Re: deleting spaces

2002-10-14 Thread Wiggins d'Anconia
Welcome to the world of regular expressions perldoc perlretut - for lots of info for your problem: $variable =~ s/\s//g; http://danconia.org learn perl wrote: > Hi guys, > > I have a simple question. > > Is there ways to get rid of any spaces within a variable? > > say the variable h

Re: Help with pipes

2002-10-14 Thread david
David Gerler wrote: > I have successfully pipe a print statement to gpg. My problem is coming in > when I try to get it back out via a pipe. Can anyone tell me, is it > possible to send data to a another program and the output back with out > writing it to a file? > > This is my code to pipe it

Re: deleting spaces

2002-10-14 Thread Steve Grazzini
Learn Perl <[EMAIL PROTECTED]> wrote: > > I have a simple question. > > Is there ways to get rid of any spaces within a variable? > > say the variable holds " R" or "R " or " R ". > is there a function I could use for that? > I tried chomp but it will only get rid of the last space but > not t

RE: help with pipes

2002-10-14 Thread david
you make a couple mistakes... see below... David Gerler wrote: > > > if ($OS eq "windows") { > $outfile = ".\\$scratchPad\\"."temp1.txt"; > $cmd = "c:\\gnupg\\gpg -ea -r ezbid > $outfile"; you are rediecting the output to a file. if you try to read from STDOUT again later, you won't see them..

Re: DBD::mySQL make fails

2002-10-14 Thread Wiggins d'Anconia
It would appear that the "mysql.bundle" file is the output file: "cc -o blib/arch/auto/DBD/mysql/mysql.bundle" Is this possibly a permissions issue? or maybe a non-existing path, though I would think cc would try to create the path. How are you installing, with CPAN or manually downloading? h

Perl and MS-Excel

2002-10-14 Thread Rajendra Babu, Praveen
Hi All, I am working on to interact Perl with MS-Excel under Windows '98. In this regard I am installing a module called Spreadsheet::WriteExcel. As per the instructions at the webpage http://homepage.tinet.ie/~jmcnamara/perl/PerlExcelFaq.html, I went about installing the module. But, I get

RE: Perl and MS-Excel

2002-10-14 Thread Timothy Johnson
The standard Activestate repository also has this module, so: 1) Have you installed other modules via PPM? 2) Are you behind a firewall? 3) What version of ActivePerl are you using? -Original Message- From: Rajendra Babu, Praveen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 200

RE: Perl and MS-Excel

2002-10-14 Thread Rajendra Babu, Praveen
Hi Timothy, Please find my answers embedded below: -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 15 October 2002 10:39 AM To: 'Rajendra Babu, Praveen'; '[EMAIL PROTECTED]' Subject: RE: Perl and MS-Excel The standard Activestate repository also ha

RE: Perl and MS-Excel

2002-10-14 Thread Timothy Johnson
Check out the activestate web site for more detail, but there are some environment variables that you should try. The one I used to use is HTTP_PROXY. Go to ActiveState's site and do a search for firewall and you should find the right page. -Original Message- From: Rajendra Babu, Prave

Re: deleting spaces

2002-10-14 Thread John W. Krahn
Steve Grazzini wrote: > > There are several reasonable answers, and I'm not > sure which one you're looking for: > > 1) tr/ //d # remove all *spaces* 1.5) tr/ \n\r\t\f//d # remove all whitespace (quickly) > 2) s/\s+//g # remove all "whitespace" > > And check: > > $ perldoc -q

scripts run by nobody

2002-10-14 Thread David Gerler
How do I make a script run as a specific user. I am working on a script that uses a pipe to send information to a program that outputs to a file. It works on win2000. I have uploaded it and it runs and works correctly when run in the debugger from a shell with the command "perl -d". The only time

How to check between text & binary files

2002-10-14 Thread George P.
Hi, I want to write a .pl that will take in filenames as parameters, and print out whether the files are text files or binary files. The problem I'm having is that I can't figure out a good rule to use while deciding whether a file is a text-file or a binary-file. If someone has created such a

RE: Perl and MS-Excel

2002-10-14 Thread Rajendra Babu, Praveen
Timothy, I got the module installed without using the, "set repository tmp http://homepage.eircom.net/~jmcnamara/perl"; command within the PPM(Perl/Programmer's Package Manager). Earlier I tried setting the HTTP_PROXY variable to my proxy server, but got the same error message. So all that I d

RE: How to check between text & binary files

2002-10-14 Thread Toby Stuart
my $file = "a_binary_file.exe"; # my $file = "a_text_file.txt"; if (-B $file) # -B is opposite of -T (text) { print "$file is binary\n"; } else { print "$file is NOT binary\n"; } > -Original Message- > From: George P. [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, Octobe

RE: Perl and MS-Excel

2002-10-14 Thread Timothy Johnson
I tried searching the repository listed, and I got an error, so I don't think the firewall is the issue, but the repository (or lack thereof) itself. The URL is valid, but perhaps the repository is gone and only the webpage is there. Incidentally, the set repository command resets when you clos

RE: scripts run by nobody

2002-10-14 Thread Timothy Johnson
What is the OS of the server you are uploading it to? -Original Message- From: David Gerler [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:04 PM To: Beginners Subject: scripts run by nobody How do I make a script run as a specific user. I am working on a script that uses