Re: getting e-mail from IMAP server help

2002-11-20 Thread Marco Centemeri
Sorry I forget that I'm runing on win2000. [EMAIL PROTECTED] wrote: > > Hi All and thanks in advance for help! > > I receive some weekly reports in my mail account, what I need is a script > which check if im my e-mail account are present messages with a specified > subject and if true move th

getting e-mail from IMAP server help

2002-11-20 Thread Marco Centemeri
Hi All and thanks in advance for help! I receive some weekly reports in my mail account, what I need is a script which check if im my e-mail account are present messages with a specified subject and if true move the attached file to a specified folder and then delete the message. I already read he

output from an array

2002-11-20 Thread Jose Malacara
Can someone please tell me what I'm doing wrong here? I have a data file that looks like this: jason,texas,austin tim,denver,colorado jose,oregon,portland And a script to update the last field and output the results with the new city: #!/usr/bin/perl -w open(DATAFILE, "datafile") || die "Una

Re: passing an array and a hash to a subroutine.

2002-11-20 Thread David Buddrige
Hi all, I have figured out the solution to the problem below is to use an array of references to the various objects that I want to pass into the subroutine. thanks guys David. David Buddrige wrote: Hi all, I want to write a subroutine that takes an array and a hash as input parameters and

Re: passing an array and a hash to a subroutine.

2002-11-20 Thread David Buddrige
Hi all, I am writing a subroutine which is intended to take an array of strings, and concatenate each string in the array into a single [very long] string. The subroutine is listed below. My problem is that for some reason when I print out the variable "$single_comment_line", rather than get

passing an array and a hash to a subroutine.

2002-11-20 Thread David Buddrige
Hi all, I want to write a subroutine that takes an array and a hash as input parameters and then does some work on them. I can't seem to determine how to do this however; it seems that with a subroutine, all you can pass is a single array ( which appears as @_ ) to the subroutine. The program

Re: converting "strange" characters

2002-11-20 Thread Josimar Nunes de Oliveira
Dear Cordeiro, I wrote some lines of code to produce a translation from <"portuguese" character set> to <"regular" alpha char set>. Does anybody has any idea to enhance this code or a perl module to replace it? %charset = ( "á" => "a", "Á" => "A", "ã" => "a", "Ã" => "A", "à" => "a", "À" =

a belated thank-you re: GetOpt(s)

2002-11-20 Thread Caroline Allen
Hi folks, I just wanted to say thanks to the various people who sent in sample code for using GetOpt: Beau Cox, Japhy Pinyan, John Krahn, and others whose names I'm not remembering -- my appy-polly-loggys to them (that's a _Clockwork Orange_ reference, it's one of my favorite novels). I realized

RE: substitution

2002-11-20 Thread Timothy Johnson
One more thing: Since we're talking about W2k, you can also use $ENV{USERPROFILE} in place of C:\Documents and Settings\chrisz. Of course that won't really help you in this case since you are interpolating it into a regular expression, but it can be handy in the long run to know. -Original

RE: substitution

2002-11-20 Thread Timothy Johnson
There are two things happening here. 1) You need to include the e switch at the end of your s/// expression. Otherwise the second part of the substitution is taken literally. 2) When you use a variable as the first part of a regular expression, it is interpolated first, and then the resul

Re: substitution

2002-11-20 Thread Wiggins d'Anconia
Two things... Chris Zampese wrote: Hi everyon, thanks for your help so far I am trying to substitute a path for another path. I have html documents which refer to some images in the following directory: C:\Documents and Settings\chrisz\Desktop\Web_notes\PFLogo.gif I would like to change th

Re: Parsing Logfiles

2002-11-20 Thread Wiggins d'Anconia
I do not get this with the code you pasted in? Normally taht would be a scoping issue from strict, but your scoping appears correct. With what your script does you need no other modules. The only thing that warned was the following: Use of uninitialized value in join or string at ./temp.pl li

substitution

2002-11-20 Thread Chris Zampese
Hi everyon, thanks for your help so far I am trying to substitute a path for another path. I have html documents which refer to some images in the following directory: C:\Documents and Settings\chrisz\Desktop\Web_notes\PFLogo.gif I would like to change this so it reads: .../PFLogo.gif I hav

Parsing Logfiles

2002-11-20 Thread leon probert
Hi, I'm trying to parse a logfile using the example from the book 'Perl for Web Site Management.'I keep getting the errors 'Global symbol "$auth_user" requires explicit package name at ./log_report.plx line 21. The code I'm using is below. Do I need to import a module? If anyone can point me in

Re: Big hash question.

2002-11-20 Thread David Zhuo
Mark, A couple things: 1. if you have something like 099, Perl thinks that you mean the Octal value of 99. The leading 0 makes Perl think you mean Octal instead of digit. For example: my $i = 99; #-- means the value 99 my $j = 099; #-- means the value 99 in Octal Now, since the Octal number sy

Re: @array to %hash

2002-11-20 Thread Larry Coffin
>I have 2 arrays I would like to make into a (one) hash. > >One array for keys. >One array for values. > >I'm sure this may be an easy thing, but my lack of imagination is killing me >(and I need something a little more comprehensive than Beginners Perl) A quick easy way to do it given @ke

RE: @array to %hash

2002-11-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
The real pain here is that the files have to be in sync otherwise the data becomes a mess. Given the above: my @MyArray1 = qw(5 4 3 2 1 6 9 11 12); my @MyArray2 = qw(cat dog mouse mice tree shrub sap unix max); if ( scalar(@MyArray1) != scalar(@MyArray2) ) { printf "Expecting

@array to %hash

2002-11-20 Thread Fogle Cpl Shawn B
I have 2 arrays I would like to make into a (one) hash. One array for keys. One array for values. I'm sure this may be an easy thing, but my lack of imagination is killing me (and I need something a little more comprehensive than Beginners Perl) tia shawn -- To unsubscribe, e-mail: [EMAIL PRO

RE: Transport endpoint is not connected:tcp socket

2002-11-20 Thread Kipp, James
> I am kind of beginner with socket prog .I am just trying to > connect a server and a client.I am unable to receive data > from the client. > > my output is > > port :2354 > addr = 2 > 127.0.0.1 > cant receive Transport endpoint is not connected > > > What does "Transport endpoint is not c

Re: Determining when a file was created???

2002-11-20 Thread John W. Krahn
David --- Senior Programmer Analyst --- Wgo Wagner wrote: > > Use stat and it has create timestamp. > > $MyCreateTime = (stat($file))[10]; # pulls create time perldoc -f stat [snip] 8 atimelast access time in seconds since the epoch 9 mtimelast modif

RE: opendir questions

2002-11-20 Thread Kipp, James
> > > my ( $name, $uid, $dir ); > while ( ( $name, undef, $uid, undef, undef, undef, undef, $dir ) = > getpwent()) { >next if ( $name =~ /users/ || $name =~ /www/ || $name =~ /sysop/); >if ( $uid > 500 ) { > if (-l $dir ) { $dir = "/home2/$name"}; > my $maildir = "$dir/\*\-ma

Re: opendir questions

2002-11-20 Thread John W. Krahn
Chad Kellerman wrote: > > Hi everyone, Hello, >I am having a small problem with opendir: > > #!/usr/bin/perl -w > > # getting disk usage for users > # not quite as good as du(1) but alittle faster...maybe > # written by [EMAIL PROTECTED] > # Aug 17, 2002 > > use strict; > use diagnostics;

RE: File question

2002-11-20 Thread Kipp, James
> > Hi everyone, > >Is there a way to open a file in a folder/s above/below > the one the > script is in? (OS is win2k), > > Thanks, > Chris. sorry to be brief but pressed for time. Try using the Cwd module. this way it is easy to tell where you are, therefore easier to cd to par

Re: how can I grab the first line from a text file

2002-11-20 Thread Frank Wiles
.--[ [EMAIL PROTECTED] wrote (2002/11/20 at 11:35:11) ]-- | | I know there must be an easy way to do this... | help greatly appreciated, Thanks | `- open(IN, "myfile.txt") or die "Cannot open file: $!\n"; my $first_line =

RE: how can I grab the first line from a text file

2002-11-20 Thread Mark Anderson
First open the file using open: perldoc -f open Then use the filehandle (FILE for instance) to put the first line in $str: $str = ; Then if you don't want to do anything else with the file, close it: perldoc -f close -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] S

Re: File question

2002-11-20 Thread Han Fleet
Hi, if you have a file called index.txt in the folder the cgi-bin is in, you can use the following code. open (TFILEX,"../index.txt") || &error2; Use ../ to go backward in the pathway. Han. Is there a way to open a file in a folder/s above/below the one the script is in? (OS is win2k)

how can I grab the first line from a text file

2002-11-20 Thread bengleto
I know there must be an easy way to do this... help greatly appreciated, Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: File question

2002-11-20 Thread Timothy Johnson
Yes. You can use relative paths in Win32 just like most other OS. Just remember that "." represents the current directory and ".." represents the parent directory. Also remember that you can use the "/" slash to separate your directories when using Perl if you want. For example: open(INFILE,"

File question

2002-11-20 Thread Chris Zampese
Hi everyone, Is there a way to open a file in a folder/s above/below the one the script is in? (OS is win2k), Thanks, Chris. _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=featur

RE: Determining when a file was created???

2002-11-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Use stat and it has create timestamp. $MyCreateTime = (stat($file))[10]; # pulls create time Wags ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 10:05 To: [EMAIL PROTECTED] Subject: Determining when a file

Re: Determining when a file was created???

2002-11-20 Thread Ovid
--- [EMAIL PROTECTED] wrote: > Hello, > > I'm trying to have a script check when a file was created. I've looked > at the file test operators (-C) but it looks like those wont help me > because they return file ages since the script started running, I need > something more like a timestamp. A

Determining when a file was created???

2002-11-20 Thread bengleto
Hello, I'm trying to have a script check when a file was created. I've looked at the file test operators (-C) but it looks like those wont help me because they return file ages since the script started running, I need something more like a timestamp. Any ideas? Thank you in advance for any h

opendir questions

2002-11-20 Thread chad kellerman
Hi everyone, I am having a small problem with opendir: #!/usr/bin/perl -w # getting disk usage for users # not quite as good as du(1) but alittle faster...maybe # written by [EMAIL PROTECTED] # Aug 17, 2002 use strict; use diagnostics; $|++; my ( $name, $uid, $dir ); while ( ( $name, undef

install ODBC DRIVER MANAGER

2002-11-20 Thread Jerry Preston
OK, I am trying to install DBD-ODBC. I ran the perl Makefile.PL -o odbchir. IT say: Using /usr/local/lib/per;5/site_perl/5.8.0/sun4-solaris/DBI It says that I need to like to ODBC 'Driver Manager'. What is this and where and how do I get one or install one? Thanks, Jerry

RE: accessing access

2002-11-20 Thread Jerry Preston
Bob, Good find!! Now I need to install ODBC sense it is not found. Thanks, Jerry -Original Message- From: Bob Rasey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 7:50 AM To: [EMAIL PROTECTED] Cc: Beginners Perl Subject: Re: accessing access On Wed, 2002-11-20 at 08:0

Re: simple (???) regex help

2002-11-20 Thread Jeff 'japhy' Pinyan
On Nov 20, Marco Centemeri said: >How can I know if a variable is exactly 6 digit long? if ($str =~ /\A\d{6}\z/) { ... } The \A matches the beginning of the string, \d{6} matches 6 digits, and the \z matches the end of the string. If you meant "characters" instead of "digits", don't use a reg

RE: simple (???) regex help

2002-11-20 Thread wiggins
perldoc -f length http://danconia.org On Wed, 20 Nov 2002 16:03:35 +0100, Marco Centemeri <[EMAIL PROTECTED]> wrote: > Hi All!! > > How can I know if a variable is exactly 6 digit long? > > I tried: > >$myvar='ABCDEF'; >if ($myvar =~ /

Re: Big hash question.

2002-11-20 Thread mark
Thanks David, this works in the form that you gave me. However, I am butchering it up to try and see if it will work with all the values I have and I run into this error. Illegal octal digit '9' at noname.pl line 10, at end of line I get the impression that perl is interpreting one of my zips as

SNMP

2002-11-20 Thread Wim De Hul
Hello, Does anyone knows how the translate-function works in Net::SNMP? Cheers! Wim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

simple (???) regex help

2002-11-20 Thread Marco Centemeri
Hi All!! How can I know if a variable is exactly 6 digit long? I tried: $myvar='ABCDEF'; if ($myvar =~ /.{6}/) { print "TRUE";} else { print "FALSE";} and I found that this expression is alway TRUE for {..}<=6 and become FALSE for {..}>=7 . Thank for help Ma

Summing list of numbers...

2002-11-20 Thread wiggins
Please always e-mail the beginners list, and let everyone try to help solve your questions as I definitely don't have all the answers... You will need to provide more information about the specifics and should probably go through some of the beginners manuals first for this type of question. Bu

RE: remsh - sh - ARGV from one script to another -

2002-11-20 Thread wiggins
Try single quoting the string that makes up the command you are passing to sh, I think everything after your /installP.pl is getting taken as arguments to sh rather than to installP.pl. so: $cmd = "remsh $remhost -l root \"sh -c '/installP.pl $PATCHFILE $option $ARGV[2]' \" "; That should not

remsh - sh - ARGV from one script to another -

2002-11-20 Thread PRADEEP GOEL
Hi all i am facing a quite crucial problem i.e. script one contains " $cmd = "remsh $remhost -l root \"sh -c /installP.pl $PATCHFILE $option $ARGV[2] \" "; print "system(\"$cmd\")"; system("$cmd "); " print "system(\"$cmd\")"; correctly prints system("remsh nnmhpt1 -l root "sh -c /installP.pl

Re: accessing access

2002-11-20 Thread Bob Rasey
On Wed, 2002-11-20 at 08:04, Jerry Preston wrote: > for the code: > > my $dbh = DBI->connect( "dbi::ODBC:pfawtbls.mdb", "", "", ) or die ^ extemporaneous colon, no? Bob Rasey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

RE: accessing access

2002-11-20 Thread Ralph . Carey
Guess the windows stuff wouldn't be much help then :) I suppose there must be also be a need to tell Unix what ODBC driver to use for a particular database, but I have no idea how you do that, sorry. Ralph -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED]] Sent: 20 Novemb

RE: accessing access

2002-11-20 Thread Jerry Preston
Ralph, I am running on a SUN Unix system. I have DBI installed, but I guess I am missing this part of it. Regards, Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 7:13 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE

RE: accessing access

2002-11-20 Thread Ralph . Carey
Have you set up your ODBC driver via Control Panel (or Computer Management in W2K)? Ralph -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED]] Sent: 20 November 2002 13:05 To: Beginners Perl Subject: accessing access Hi! I am trying to access an access mdb file for the fi

accessing access

2002-11-20 Thread Jerry Preston
Hi! I am trying to access an access mdb file for the first time. I get the following error: Can't connect(dbi::ODBC:pfawtbls.mdb ), no database driver specified and DBI_DSN env var not set at jfa_data.pl line 147 for the code: my $dbh = DBI->connect( "dbi::ODBC:pfawtbls.mdb", "", "", ) or d