Re: Parsing emails in mailbox

2002-04-12 Thread Elaine -HFB- Ashton
Ankit Gupta [[EMAIL PROTECTED]] quoth: *> *> I need help to parse emails for their From, UID and message text fields *>from a local mailbox file (unix type). I am using Windows Me and any sort of *>help in this direction would be highly appreciated. If someone can provide *>some sample code, that

Re: help with crypt anf pack

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 07:55 PM, Gabriel Duchateau wrote: > I am trying to setup a small application with a passwd controlled access. > I > need just a little bit of security so I decided to use the crypt function > on > perl to encrypt the user passwd. The problem I have is when writi

help with crypt anf pack

2002-04-12 Thread Gabriel Duchateau
I am trying to setup a small application with a passwd controlled access. I need just a little bit of security so I decided to use the crypt function on perl to encrypt the user passwd. The problem I have is when writing the encrypted passwd to a file using the pack function. The pack function ret

Re: what is the value of WNOHANG?

2002-04-12 Thread Jeff 'japhy' Pinyan
On Apr 12, Ahmed Moustafa said: >I found it in . It was 0x0001. > >Is use POSIX ":sys_wait_h"; portable? Far more portable than blindly using 0x01. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://w

Re: what is the value of WNOHANG?

2002-04-12 Thread Ahmed Moustafa
I found it in . It was 0x0001. Is use POSIX ":sys_wait_h"; portable? Ahmed Moustafa wrote: > > waitpid $pid,&WNOHANG; > > > What is the value of the flag WNOHANG in waitpid? > What does it mean when $pid is -1? > > Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

what is the value of WNOHANG?

2002-04-12 Thread Ahmed Moustafa
waitpid $pid,&WNOHANG; What is the value of the flag WNOHANG in waitpid? What does it mean when $pid is -1? Thanks in advance. -- Ahmed Moustafa http://pobox.com/~amoustafa -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Input | Program | Output : help

2002-04-12 Thread John W. Krahn
"Tirthankar C. Patnaik" wrote: > > Thanks a lot. Your guess was right. The second part was what I needed. I am > still not a little confused about the first, though. They do not teach > this in the institution where I study. :) > > Could you give a good reference to this things, IPC, pipes, fifo

Re: while and do

2002-04-12 Thread Teresa Raymond
Thanks to all... >Some useful perl control structures: > >do { statements; } while someexpression; >do { statements; } until someexpression; >while (someexpression) { statements; } --or-- statement while >someexpression; >until (someexpression) { statements; } --or-- statement until >someexpressi

Re: Find and replace a word or characater in a the same file.

2002-04-12 Thread John W. Krahn
Guan boon lee wrote: > > I would like to find a word or character in a file and > replace it with another word or character, while > leaving others untouched. Currently, I am using the > following method > > #!/bin/perl -Dr -w > open(FILE,"$ARGV[0]") || die "Can't open $ARGV[0]: > $!\n"; > open

Re: pattern match

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 12:58 PM, David Gray wrote: >> for e.g : >> >> (not showing the new lines..) >> >> >> word1.word1.word1word2word1...word2wor >> d2word2 >> . > > You're gonna want to check out (in the perldoc perlre manpage) (??{ code > }), which

Re: max/min

2002-04-12 Thread Elias Assmann
On Fri, 12 Apr 2002, Jonathan E. Paton wrote: > Yes, it should be optimised away, but why would you do it in the first place? If > you tell it to do something, then why should it shy away from doing what it was > told? Optimising things that don't occur in everyday programming is a waste of > ti

Re: More HTML::Template help

2002-04-12 Thread Jenda Krynicky
From: Elaine -HFB- Ashton <[EMAIL PROTECTED]> > A Taylor [[EMAIL PROTECTED]] quoth: > *> > *>My question is where do I run these commands from - I have > downloaded and *>un-zipped the HTML-Template fron CPAN but am having > difficulties installing *>it. I was hoping that it woul

Parsing emails in mailbox

2002-04-12 Thread Ankit Gupta
Hello, I need help to parse emails for their From, UID and message text fields from a local mailbox file (unix type). I am using Windows Me and any sort of help in this direction would be highly appreciated. If someone can provide some sample code, that will be really very nice. Looking forward

Re: comparing files

2002-04-12 Thread Jerry Preston
Jenda, I want to which lines are different. Thanks, Jerry Jenda Krynicky wrote: > From: Jerry Preston <[EMAIL PROTECTED]> > > > I want to compare one file to another. Is it better to read the files > > line by line into an array or and hash or what is the best and or > > fastest? These file

Re: comparing files

2002-04-12 Thread Jenda Krynicky
From: Jerry Preston <[EMAIL PROTECTED]> > I want to compare one file to another. Is it better to read the files > line by line into an array or and hash or what is the best and or > fastest? These files are less than 100 lines. Depends on what do you mean by "compare". Do you want to get the

RE: comparing files

2002-04-12 Thread Nikola Janceski
On a serious note... I just did a quick search on cpan (search.cpan.org) for 'diff' and a bunch of stuff came up.. but I never used any of it. You might want to check Algorithm::Diff if you are diffing two files. > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Se

Re: max/min

2002-04-12 Thread Jonathan E. Paton
> > > I'm a litttle puzzled as to why max2 (foreach with if modifier) is > > > consistently about 25% faster than max4 (foreach with ternary operator). > > > My guess is that the difference is due to how often the assignment is > > > done. With the if modifier, the assignment is done only when ne

RE: comparing files

2002-04-12 Thread Nikola Janceski
On UNIX it's called diff. >8^P > -Original Message- > From: Jerry Preston [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 4:23 PM > To: begginners > Subject: comparing files > > > I want to compare one file to another. Is it better to read the files > line by line into an arr

comparing files

2002-04-12 Thread Jerry Preston
I want to compare one file to another. Is it better to read the files line by line into an array or and hash or what is the best and or fastest? These files are less than 100 lines. Thanks, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: max/min

2002-04-12 Thread Elias Assmann
On Fri, 12 Apr 2002, Jonathan E. Paton wrote: > > I'm a litttle puzzled as to why max2 (foreach with if modifier) is > > consistently about 25% faster than max4 (foreach with ternary operator). > > My guess is that the difference is due to how often the assignment is > > done. With the if modifie

RE: pattern match

2002-04-12 Thread David Gray
> for e.g : > > (not showing the new lines..) > > > word1.word1.word1word2word1...word2wor > d2word2 > . You're gonna want to check out (in the perldoc perlre manpage) (??{ code }), which is an example of a recursive regular expression. They have an exampl

Re: pattern match

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 12:38 , Raghupathy, Ramesh . wrote: > I am sorry I was not clear in my question. > >The word1 and word2 may occur on different lines of the file and may > occur in different combinations. > > for e.g : > > (not showing the new lines..) > > > word1.word1.

RE: splitting / regex / trend etc

2002-04-12 Thread David Gray
> @fruitname = split /[,\s]+/ => ; > ... >@fruit{ @fruitname } = split /[,\s]+/ => $_ ; Mr. Big "Fancy Comma" Man ;) That's cool, an extra step of simplification... Very nicely done. -dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: shrinking code

2002-04-12 Thread Timothy Johnson
They should. $m has an undef value when the loop starts, which will evaluate to 0 in numerical context. When the $m++ operation happens, $m becomes one. Thus, the final loop will occur when $m has a value of 79, but it will be the 80th iteration. Or did you notice something else that I didn't

RE: pattern match

2002-04-12 Thread Timothy Johnson
If word1 and word2 are on the same line, you could do something like this: open(INFILE,"myfile.txt"); open(OUTFILE,">results.txt"); while(){ while($_ =~ /word1(.*)word2/g){ #get all characters between word1 and word2, one match at a time print OUTFILE $1."\n"; } } Someone else might

RE: shrinking code

2002-04-12 Thread LoBue, Mark
Those don't necessarily do the same thing, do they?: > print "-" x 80; Prints 80 dashes. > > while($m < 80){ > > print "-"; > > $m++ > > } Prints some number of dashes, 80 or less, depending on the initial value of $m. This could be used in check printing software, etc. (Not that I'm offering

Re: max/min

2002-04-12 Thread Jonathan E. Paton
> >> After I sent this I had a flash of enlightenment: > >>$max = (sort {$a <=> $b} @_)[-1]; > >> May be slower, though, I don't know. > > > > How many times have I seen this? I mean, I've seen > > this construct many times, and the question deserves > > a place in the Perl FAQ. > > How to f

Re: foreach v. c-style for loop was Re: Fidning the index of an array

2002-04-12 Thread Jonathan E. Paton
> >> my @array = (1 .. 100); > >> my $counter = 0; > >> > >> for (@array) { > >> print "index -> $counter element -> $_\n"; > >> $counter++; > >> } > > > > The other approach is to use a C-style for-loop. > > Is there any given advantage of one over the other in > terms of performance and/o

RE: Find and replace a word or characater in a the same file.

2002-04-12 Thread David Gray
> I would like to find a word or character in a file and > replace it with another word or character, while > leaving others untouched. Currently, I am using the > following method > > #!/bin/perl -Dr -w > open(FILE,"$ARGV[0]") || die "Can't open $ARGV[0]: > $!\n"; > open(FILE2,">$ARGV[0].spi")

RE: splitting / regex / trend etc

2002-04-12 Thread Hooten, Michael
Very similar approach with nice formatting. --- use warnings; use strict; my (@day, @fruitname, %totals); my $x; open DATA, "data.txt"; @fruitname = split /[,\s]+/ => ; while ( ) { my %fruit; @fruit{ @fruitname } = split /[,\s]+/ => $_ ; $day[$

Re: More HTML::Template help

2002-04-12 Thread Elaine -HFB- Ashton
A Taylor [[EMAIL PROTECTED]] quoth: *> *>My question is where do I run these commands from - I have downloaded and *>un-zipped the HTML-Template fron CPAN but am having difficulties installing *>it. I was hoping that it would be as easy as TELNETing in to the server *>space but I cant even do t

RE: Input | Program | Output : help

2002-04-12 Thread Nikola Janceski
perldoc perlipc IPC - InterProcess Communication It's a trick devil of a subject, lots of restrictions (OS) and bugs (also OS) when you delve too deep. > -Original Message- > From: Tirthankar C. Patnaik [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 2:34 PM > To: Nikola Jance

RE: Input | Program | Output : help

2002-04-12 Thread Tirthankar C. Patnaik
Thanks a lot. Your guess was right. The second part was what I needed. I am still not a little confused about the first, though. They do not teach this in the institution where I study. :) Could you give a good reference to this things, IPC, pipes, fifo, sockets, etc? I could not make much head

pattern match

2002-04-12 Thread Raghupathy, Ramesh .
Hi All, I have a file which has several occurances of word1 and word2 interspersed with other text. I need to extract only the text which is contained between consecutive occurances of word1 and word2 in that order. Is it possible to write a pattern match for this ? Thanks, Ramesh -- To un

RE: Input | Program | Output : help

2002-04-12 Thread Nikola Janceski
no... Open2 opens 2 filehandles for a command. this: open2(*READ, *ZIPIT, "/apps/bin/zip $FORM{'zipfile'} -@ 2>&1"); opens a filehandle READ that the command reads from AND opens a filehandle ZIPIT that the command outputs from at a command prompt this is what it means: cat | /apps/bin/zip som

RE: Input | Program | Output : help

2002-04-12 Thread Tirthankar C. Patnaik
> did you try reading the docs? You didn't even try to use my example. I did try. I could not understand your example. Let me explain: > > > open2(*READ, *ZIPIT, "/apps/bin/zip $FORM{'zipfile'} -@ 2>&1"); > > > READ is the input pipe > > > ZIPIT is the output pipe Here, are *READ, and *ZIPI

foreach v. c-style for loop was Re: Fidning the index of an array

2002-04-12 Thread drieux
On Thursday, April 11, 2002, at 05:09 , Jeff 'japhy' Pinyan wrote: >> my @array = (1 .. 100); >> my $counter = 0; >> >> for (@array) { >> print "index -> $counter element -> $_\n"; >> $counter++; >> } > > The other approach is to use a C-style for-loop. Is there any given advantage of one

RE: Input | Program | Output : help

2002-04-12 Thread Nikola Janceski
did you try reading the docs? You didn't even try to use my example. perldoc IPC::Open2 > -Original Message- > From: Tirthankar C. Patnaik [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 1:52 PM > To: Nikola Janceski > Cc: [EMAIL PROTECTED] > Subject: RE: Input | Program | Outp

RE: Input | Program | Output : help

2002-04-12 Thread Tirthankar C. Patnaik
I'm afraid I couldn't succeed in using the IPC::Open2 module. Where am I going wrong? # } my($IN,$OUT); open(OUT,"| discretise ${delta} ${BOD} ${EOD}") || die "Sorry out: $!"; if($suffix eq ".par"){ open(IN,"<$ParseFile") || die "Sorry: $!"; open2('IN','OUT'); }

Re: max/min

2002-04-12 Thread Richard J. Barbalace
Jonathan Paton writes: >> After I sent this I had a flash of enlightenment: >>$max = (sort {$a <=> $b} @_)[-1]; >> May be slower, though, I don't know. > > How many times have I seen this? I mean, I've seen > this construct many times, and the question deserves > a place in the Perl FAQ. How

One Print, One WebPage was Re: Preview data

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 10:05 , Nikola Janceski wrote: > And why can't you do the same with the CGI module? > $page_o_html = hidden(-name => 'crap', -value => $crap); > would be the same thing. > > You lost me on that... Mea Kulpa... essential it's the case of s/print/$page_o_htm

Re: Preview data

2002-04-12 Thread Jenda Krynicky
From: drieux <[EMAIL PROTECTED]> > Given the original concern to 'retain' the "This Quote" in the > hidden field, there is now the problem of decode_entities perchance > more than once??? > > original input: "This Quote" > saved as hidden: $quot;This Quote$quot; > > so the >

RE: Input | Program | Output : help

2002-04-12 Thread Nikola Janceski
You might want to look at IPC::Open2 You can open a system command with an INPUT pipe and OUTPUT pipe. Here is how I used it. open2(*READ, *ZIPIT, "/apps/bin/zip $FORM{'zipfile'} -@ 2>&1"); READ is the input pipe ZIPIT is the output pipe Perl Gurus, Yeah I should have used the ZIP module.. I a

Re: Preview data

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 09:51 , Jenda Krynicky wrote: [..] > Keep in mind that the user might have entered those ", < > and others. So if you want them to survive you have to escape > them. Even if that would mean the page will contain > > > > if the user entered > 1 < 2 YIKE

Input | Program | Output : help

2002-04-12 Thread Tirthankar C. Patnaik
Folks, Consider this code snippet: Here $ParseFile is a plain-text file, which could be gzipped, bzipped, or not compressed at all. I'd like my program to determine this, open the file, and cat it to another program called discretise. In the code below, my(@PARSELIST) = @ARGV;

RE: Preview data

2002-04-12 Thread Nikola Janceski
And why can't you do the same with the CGI module? $page_o_html = hidden(-name => 'crap', -value => $crap); would be the same thing. You lost me on that... plus if you really need to, I have ADDED the CGI at a later point to a pre-existing script and only change the portions that I really wanted

Re: Preview data

2002-04-12 Thread Jenda Krynicky
From: drieux <[EMAIL PROTECTED]> > It would seem that the current CGI.pm should not > retranslation of " into " - or am I being naive? If CGI.pm would be made by Microsoft then it would not. And if you needed to put into a hidden field something that already is HTML it'll screw things up.

Re: precedence

2002-04-12 Thread Jeff 'japhy' Pinyan
On Apr 10, Nikola Janceski said: >What does the (left/right/nonassoc) mean? They mean "left-associative", "right-associative", or "non-associative". They govern what DIRECTION things are evaluated in. $x + $y + $z evaluates LEFT to right -- the ($x + $y) is done first, not the ($y + $z). On

Re: Find and replace a word or characater in a the same file.

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 09:09 AM, Guan Boon Lee wrote: > I would like to find a word or character in a file and > replace it with another word or character, while > leaving others untouched. Currently, I am using the > following method > > #!/bin/perl -Dr -w > open(FILE,"$ARGV[0]") || di

syb_err_handler subroutine question

2002-04-12 Thread Alain Savio
Hi all, Despite what the documentation says on this topic, I'm unable to have the 8th parameter of syb_err_handler even after having set syb_show_sql to true: use DBI; # --- # Errors handling # --- sub msg_handler_SYB { print join ( "| ", @_), "\n"; } $sth = $dbh_db

Re: Need help grabbing program output.

2002-04-12 Thread Jeff 'japhy' Pinyan
On Apr 12, drieux said: >On Friday, April 12, 2002, at 09:09 , bob ackerman wrote: >[..] >>> $tmp = system $selection; >>> >> >> try: >> $tmp = `$selection`; >> >> to get back results that command sends to stdout. >> >>> return $tmp; > >what is the 'special variable' that would get set th

Re: Need help grabbing program output.

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 09:09 , bob ackerman wrote: [..] >> $tmp = system $selection; >> > > try: > $tmp = `$selection`; > > to get back results that command sends to stdout. > >> return $tmp; what is the 'special variable' that would get set that would return the exit code of runn

Re: Preview data

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 08:41 , Jenda Krynicky wrote: [..] > Yes, if you can use that I fully agree you should, but if you have > some html "template" you fill in you have to make sure you escape > your data yourself :-) the horrors of 'maintaining' code that should have started with CGI.p

Re: Need help grabbing program output.

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 08:05 AM, Timothy A. DeWees wrote: > Hello, > > I am trying to convert a shell script to perl because I need to do > some > binary math, and I want to add more flexibility in general.I'm a bit > new > to perl, but here is my question (don't laugh). > > I

Find and replace a word or characater in a the same file.

2002-04-12 Thread Guan Boon Lee
I would like to find a word or character in a file and replace it with another word or character, while leaving others untouched. Currently, I am using the following method #!/bin/perl -Dr -w open(FILE,"$ARGV[0]") || die "Can't open $ARGV[0]: $!\n"; open(FILE2,">$ARGV[0].spi") || die "Can't open

Re: Need help grabbing program output.

2002-04-12 Thread Jeff 'japhy' Pinyan
On Apr 12, Timothy A. DeWees said: >I am trying to execute an external process (in this case dialog). Dialog >displays a menu to the user and will output there selection via stdout or >stderr. I want to take what the system call to dialog will pass to stdout >or stderr and assign it to a string

cgi / select / update question

2002-04-12 Thread Johnson, Shaunn
Howdy: Still looking for examples / pointers ... I am still butchering a page where I connect to the database and get a list of tables. That works - My goal is to figure out how to select a table and update the Description / input comments for the table (and maybe - being SUPER ambitious - a

Need help grabbing program output.

2002-04-12 Thread Timothy A. DeWees
Hello, I am trying to convert a shell script to perl because I need to do some binary math, and I want to add more flexibility in general.I'm a bit new to perl, but here is my question (don't laugh). I am trying to execute an external process (in this case dialog). Dialog displays a men

Trying to qualify search results

2002-04-12 Thread MarcusWillemsen
Hi everybody, I set up a database (MySQl) for our intranet that holds all the articles written by our journalists. You can do the usual things edit articles, insert new articles and search for articles. The search function is a very plain, full text search for single or multiple words, and se

Re: Preview data

2002-04-12 Thread Jenda Krynicky
From: drieux <[EMAIL PROTECTED]> > On Friday, April 12, 2002, at 07:55 , Jenda Krynicky wrote: > > > No it will not. > > just figured that out > [..] > > This is the safest method: > > > > use HTML::Entities; > > $hiddenField = encode_entities(param('hiddenField')); > > > > $html

Re: Preview data

2002-04-12 Thread Kris G Findlay
exellent Jenda .. thats spot on. exactly what i was looking for. thanx to you all for your help it was much apreciated - Kris G Findlay http://www.knight-shift.com - Original Message - From: "Jenda Krynicky" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, A

RE: Mod_Perl -- A very basic question to get started

2002-04-12 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 10:28 AM > To: [EMAIL PROTECTED] > Subject: Mod_Perl -- A very basic question to get started > > > > Hello Friends, > > I have all the web-development done in ASP for W2K with IIS

Re: Preview data

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 07:55 , Jenda Krynicky wrote: > No it will not. just figured that out [..] > This is the safest method: > > use HTML::Entities; > $hiddenField = encode_entities(param('hiddenField')); > > $html = qq{ value="$hiddenfield">}; > > Jenda I think

RE: max/min

2002-04-12 Thread Elias Assmann
On Thu, 11 Apr 2002, Bryan R Harris wrote: > > ACK! void use of map! > Huh? Is that "void" or "avoid"? What's wrong with map? void. You're using map in void context here (which means, if I'm not mistaken, you throw the return value away without using it), and this is said to be a Bad Thing (tho

More HTML::Template help

2002-04-12 Thread A Taylor
I am trying to install HTML::Template into a local directory and it seems that i have to use the following: perl Makefile.PL PREFIX=/path_to_your_home \ INSTALLPRIVLIB=/path_to_your_home/lib/perl5 \ INSTALLSCRIPT=/path_to_your_home/bin \ INSTALLSITELIB=/path_to_your_home/lib/perl5/si

Re: Preview data

2002-04-12 Thread Jenda Krynicky
From: drieux <[EMAIL PROTECTED]> > On Friday, April 12, 2002, at 07:15 , Kris G Findlay wrote: > > > ok exact problem !! > > > > Example data inputed via form : > > 'here is a quote "this Quote".' # which is passes to variable > > $document > > > > if i use hidden fields in a html form to st

Re: problem sending mail

2002-04-12 Thread Luke Sibala
... or try Email::Sendmail luke On Wed, 10 Apr 2002 15:33:10 -0400 fliptop <[EMAIL PROTECTED]> wrote: > t3tsu0 wrote: > > > Where: > > > > $mail_prog= '/usr/bin/sendmail'; > > > > > > sub send_mail { > > local($from,$to_name,$to_addr,$subject,$content) = @_; > > ope

Re: Preview data

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 07:15 , Kris G Findlay wrote: > ok exact problem !! > > Example data inputed via form : > 'here is a quote "this Quote".' # which is passes to variable > $document > > if i use hidden fields in a html form to store these variables while the > page displays a p

RE:regex tester

2002-04-12 Thread Jenda Krynicky
From: James Campbell <[EMAIL PROTECTED]> > >Is anybody use any free Regexp tester? > >Like in the OptiPerl - but it's non-free... :( > > Don't know how complicated OptiPerl is but if you just want to see > what your regex is matching: > For things like this I use PSH : http://Jenda.Krynicky.cz

Mod_Perl -- A very basic question to get started

2002-04-12 Thread RArul
Hello Friends, I have all the web-development done in ASP for W2K with IIS Web-Servers and am a newbie to mod_perl. I have a very basic question on this Perl technology. Here it is: What is the primodial or **chief use** of mod_perl with apache? --Is it to run CGI Scri

RE: Preview data

2002-04-12 Thread Nikola Janceski
again.. you should have used the CGI module... it would have no problems with that. #!perl use strict; use warnings; use CGI qw(:standard); print header(); if(param()){ print param('crap'), p(); } else { print start_form(); my $crap = 'here is a quote "

Re: Preview data

2002-04-12 Thread Kris G Findlay
ok exact problem !! Example data inputed via form : 'here is a quote "this Quote".' # which is passes to variable $document if i use hidden fields in a html form to store these variables while the page displays a preview eg print "" the html page returned displays corectly and all data is i

RE: search an executable in path

2002-04-12 Thread Timothy Johnson
Here's one way: my @path = split /;/,$ENV{PATH}; foreach(@path){ chdir $_; if(-e 'net.exe'){ print "Application found in $_!\n"; } } -Original Message- From: Jorge Goncalvez To: [EMAIL PROTECTED] Sent: 4/12/02 6:15 AM Subject: RE:search an executable in path HI, I wante

Re: Syntax def required

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 01:32 , [EMAIL PROTECTED] wrote: > It's a method invocation arrow, used for object orientated code. Try > perlboot for help (http://www.perldoc.com/perl5.6.1/pod/perlboot.html) not all '->' are OO method invocations as David Grey's most elegant code pointed out:

Re: Help with MIME::Lite module

2002-04-12 Thread Kevin Meltzer
Take the single quotes off of $nhtmlpage.. the variable isn't being interpolated. Cheers, Kevin On Fri, Apr 12, 2002 at 08:56:15AM -0400, FLAHERTY, JIM-CONT ([EMAIL PROTECTED]) said something similar to: > I am wanting to send HTML reports to clients that can read html mail. > In the Data secti

Re: splitting / regex / trend etc

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 03:56 , Mark. wrote: > apples, melon, oranges, pears, coconut, lemons, grapefruit > 4, 3, 2, 7, 1, 4, 0 > 3, 1, 4, 4, 0, 0, 1 > 0, 4, 0, 0, 4, 5, 0 http://www.wetware.com/drieux/CS/lang/Perl/Beginners/FruitPickFromCVS.txt offers an illustration about how this prob

RE: Help with MIME::Lite module

2002-04-12 Thread David Gray
> my $msg = MIME::Lite->new( >From => '[EMAIL PROTECTED]' > , >To => '[EMAIL PROTECTED]' > , >Cc => '[EMAIL PROTECTED]' , >Subject=> 'Morning Trouble Call report', >Type => 'text/html', >Data => '$rhtmlpage' > > ); > > $msg->se

RE: Problem with replacing text in a variable...

2002-04-12 Thread David Gray
> OK! > > my script works! But when I use: > > my $rvar = ; > > I have the same problem! Jesus, that's a hard one :-) After you read it in, do you have a '$' in the string? If so, you need to escape it like so: $rvar =~ s/\$/\\\$/g; That should fix the problem. If it doesn't, could you paste

RE: splitting / regex / trend etc

2002-04-12 Thread David Gray
> If I only want to get the numbers sold for lets say apples, > oranges and > grapefruit, for both stores How would I go about it? > > > apples, oranges, pears, lemons, grapefruit > 5, 0, 4, 6, 2 > 2, 6, 2, 0, 0 > 4, 7, 2, 1, 0 > > > apples, melon, oranges, pears, coconut, lemons, grape

RE: Preview data

2002-04-12 Thread Nikola Janceski
uh... Are you using the CGI module? This test CGI script can take 'hello " what?' and when submitted will return the exact same thing. What kinda problem are you really having? #!perl use strict; use warnings; use CGI qw(:standard); print header(); if(param()){ print param('crap'), p();

RE:search an executable in path

2002-04-12 Thread Jorge Goncalvez
HI, I wanted to know if the Win32 executable net.exe is on Path. How can I do this in Perl? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Preview data

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 04:30 , Kris G Findlay wrote: > i'm writing a script that takes data submited by a form and adds it to a > mysql database > but i would like to be able to preview the data as it is to be displayed > before final submission to database. i have tried using hidden for

RE: Help with MIME::Lite module

2002-04-12 Thread Nikola Janceski
you are using single quotes '' which don't interpolate. use double quotes "". > -Original Message- > From: FLAHERTY, JIM-CONT [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 8:56 AM > To: Jim (E-mail); Beginners (E-mail) > Subject: Help with MIME::Lite module > > > I am wantin

Help with MIME::Lite module

2002-04-12 Thread FLAHERTY, JIM-CONT
I am wanting to send HTML reports to clients that can read html mail. In the Data section is where you put the body of the message . If I type html and text it works fine. but when I try to add a variable the body of the message has $nhtmlpage nothing on whats in the variable. Help co

Re: Passing Arguments into a Program

2002-04-12 Thread drieux
On Thursday, April 11, 2002, at 01:53 , Mike wrote: > If a program calls a perl script as follows: /tmp/perltest.pl abc def ghi > jkl mno > > Is there a variable which would contain the arguments? yes @ARGV - in your case you would be able to play something like my $count=1; f

Re: Problem with replacing text in a variable...

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 04:59 , Wim wrote: > OK! > > my script works! But when I use: > > my $rvar = ; > > I have the same problem! Jesus, that's a hard one :-) are you expecting a single line of input to come at you? if not why not 'nest' it in a line read cycle while() {

Re: Problem with replacing text in a variable...

2002-04-12 Thread Wim
OK! my script works! But when I use: my $rvar = ; I have the same problem! Jesus, that's a hard one :-) Greetz... David Gray wrote: >>An update on previous post... >>It seems that I typed some errors :-( >> >>This is a small rewrite of my script... >>#!/usr/bin/perl >> >>use warnings; >> >>

Preview data

2002-04-12 Thread Kris G Findlay
i'm writing a script that takes data submited by a form and adds it to a mysql database but i would like to be able to preview the data as it is to be displayed before final submission to database. i have tried using hidden form fields within a prieview page but have a problem of these fields

Re: RE:regex tester

2002-04-12 Thread Kris G Findlay
try visual regex here is link .. its free http://laurent.riesterer.free.fr/regexp/ - Original Message - From: "Kris G Findlay" <[EMAIL PROTECTED]> To: "beginners" <[EMAIL PROTECTED]> Sent: Thursday, April 11, 2002 11:50 PM Subject: Re: RE:regex tester > > - Original Message

Mail Style

2002-04-12 Thread Bill Lyles
Hi I need to know how the mail stucture would look if I want to send data from a form via smtp instead of using the PRINT statement I need to use this $MAIL->datasend("or more lines\n"); How would I define the the form variables like username would it look like this? $MAIL>datasend("$userna

splitting / regex / trend etc

2002-04-12 Thread Mark .
Hello all, I've got an intresting little dunno how or where to start: Lets say, I've got numerous Comma Separated Values, for this example lets say they contain information about fruit sales for different stores... Now, there are two stores, the second store has got a wider selection than

Re: FILE::BASENAME

2002-04-12 Thread John W. Krahn
Chris Green wrote: > > I'm having problems using FILE::BASENAME and the fileparse command. I've > used the code below to try it out but get an error message saying 'Undefined > subroutine &main::fileparse called at D:\data\parse.pl line 6' > > use FILE::BASENAME Module names are Case Sensitive.

Re: FILE::BASENAME

2002-04-12 Thread p
Chris, I think perhaps a mising semi-colon and case problems could be to blame. Try use File::Basename; #observe case Because on a unix system FILE/BASENAME and File/Basename are different. Tristan You Wrote: -- I'm having problems using FILE::BASENAME and the fileparse command. I'

Re: input with the < symbol

2002-04-12 Thread John W. Krahn
Mike wrote: > > What happens if I call a perl script as follows: > > test.pl < abc The contents of the file "abc" are directed to the standard input of "test.pl" > What picks up the abc inside the script? In shell scripting I would just > use a read statement (read a). Is there a like funct

Re: Syntax def required

2002-04-12 Thread John W. Krahn
Support wrote: > > I am trying to understand the logic of this code, and am finding it hard > to find any more info on it, since I can't quite grip it. perldoc perlref perldoc perldsc > Could someone explain the flow and/meaning behind it? > I am specifically referring to the 'pointers' (->) a

FILE::BASENAME

2002-04-12 Thread Green, Chris
I'm having problems using FILE::BASENAME and the fileparse command. I've used the code below to try it out but get an error message saying 'Undefined subroutine &main::fileparse called at D:\data\parse.pl line 6' use FILE::BASENAME $record = "D:\\data\\filename.bat"; ($name,$path,$suffix) =

Re: Syntax def required

2002-04-12 Thread p
Scott, It's a method invocation arrow, used for object orientated code. Try perlboot for help (http://www.perldoc.com/perl5.6.1/pod/perlboot.html) I think O'Reilly's Advanced Perl Programming book deals with it, but you should be able to get the jist of it from the above (and the links in the

Re: Passing Arguments into a Program

2002-04-12 Thread victor
@ARGV in your example $ARGV[0] will be abc $ARGV[1] will be def ...etc Tor. Mike wrote: > > If a program calls a perl script as follows: /tmp/perltest.pl abc def ghi > jkl mno > > Is there a variable which would contain the arguments? > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > F

Re: Passing Arguments into a Program

2002-04-12 Thread Mandar Rahurkar
@ARGV is the variable ur looking for ; here is how to assign args to vars; while(@ARGV) { $var1=shift(@ARGV); $var2=shift(@ARGV); } Adios Mandar On Thu, 11 Apr 2002, Mike wrote: > If a program calls a perl script as follows: /tmp/perltest.pl abc def ghi > jkl mno > > Is there a va

input with the < symbol

2002-04-12 Thread Mike
What happens if I call a perl script as follows: test.pl < abc What picks up the abc inside the script? In shell scripting I would just use a read statement (read a). Is there a like function in perl? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

  1   2   >