Regular expression help

2004-10-21 Thread Owen
This program #!/usr/bin/perl -w use strict; while () { chomp; my $line = $_; my @y =split (/\b[\w]+:/,$line); #print scalar(@y); print $line; print "\n\$y[0] $y[0]\n\$y[1] $y[1]\n\$y[2] $y[2]\n\$y[3] $y[3]\n\$y[4] $y[4]\n\$y[5] $y[5]\n"; } __DATA__ M:356 358 386 R:#132 W1:319 NRT:32 R:#1

Re: tie problem

2004-10-21 Thread Bee
> > > >sub TIEHANDLE { my $x; bless \$x; shift } > >sub PRINT { $_ = $$_[0]; s/./*/g; print} > > Your TIEHANDLE routine is slightly broken. You want > > bless \$x, shift > > instead of > > bless \$x; shift Thanks alot, I get able to tie this time now. > > And your PRINT method is wrong. Th

Re: zcat

2004-10-21 Thread Mark Goland
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 22, 2004 1:27 AM Subject: zcat > Hi Hello, > I have a gunzip file which I have to decompress through a perl script > and copy the uncompressed file to another file. > I used this > > system('zca

Re: zcat

2004-10-21 Thread Renqilong
Try this: put the output of the shell command 'zcat -c $filename' to a variable and then write the value of the variable to another file On Fri, 22 Oct 2004 01:27:22 -0400 [EMAIL PROTECTED] wrote: > 'zcat -c $filename > out' -- Whatever you do will be insignificant,but the important is you

Re: tie problem

2004-10-21 Thread Jeff 'japhy' Pinyan
On Oct 22, Bee said: >I am just about to study about tie, and I've made a very simple test, but >don't know what's wrong, would anyone please to point out ? > ># Mask >package Mask; > >sub TIEHANDLE { my $x; bless \$x; shift } >sub PRINT { $_ = $$_[0]; s/./*/g; print} Your TIEHANDLE routine is sl

zcat

2004-10-21 Thread mk76
Hi I have a gunzip file which I have to decompress through a perl script and copy the uncompressed file to another file. I used this system('zcat -c $filename > out'); where the filename is stored in $filename. zcat gave me an error message that the output is not read from a terminal. Could you

Re: cat *.txt > .txt...........roy

2004-10-21 Thread Chris Devers
On Fri, 22 Oct 2004, Roime bin Puniran wrote: > I have tried to find if any PERL module can do my task..And i found > that File::Spec can do what i am to do.. So why are you asking the list then? > shell> cat *.txt > allweather.txt So... we should just write this for you, just like that?

cat *.txt > .txt...........roy

2004-10-21 Thread Roime bin Puniran
Hi... I have tried to find if any PERL module can do my task..And i found that File::Spac can do what i am to do..It's allow us to concatenate several .*txt file and sort it into one text file..But, i don't make any perl script on it, because i jst wanna see some examples first, to avoid me wast

Re: script how to interactive mode in telnet

2004-10-21 Thread Chris Devers
On Fri, 22 Oct 2004, Adam Saeed wrote: > i want to write a script that automatically call telnet If you *really* want telnet, use Net::Telnet But -- > and do some > stuff and exit. e.g > telnet > open > e.g port = 25 -- that's the SMTP port. If you're trying to do mail programming, you sho

script how to interactive mode in telnet

2004-10-21 Thread Adam Saeed
i want to write a script that automatically call telnet and do some stuff and exit. e.g telnet open e.g port = 25 then.. it sends helo test mail from> bla bala bla rset quit ... when i done doing it through system command , it comes to interactive mode and give prompt. telnet> then i have to

Re: previous element

2004-10-21 Thread Vladimir Lemberg
Gunnar, thank you so much! - Original Message - From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 21, 2004 4:40 PM Subject: Re: previous element > Vladimir Lemberg wrote: > > I need to access previous element in array. > > I don't see any arr

Re: previous element

2004-10-21 Thread Gunnar Hjalmarsson
Vladimir Lemberg wrote: I need to access previous element in array. I don't see any array. I see an extract from a file with records separated by blank lines. Pattern is PARKSIDE AVE. When I find it, I wont to display the previous line as well, because its one record. while(){ if (!/$pattern/i){

previous element

2004-10-21 Thread Vladimir Lemberg
I need to access previous element in array. File example: 1. SEG|2961|4| |B|N|000| | |91506|91506|Z|06| 37|0|1|Z|06|37|0|8954| 2. NAME|PARKSIDE AVE| | | |O|E|1399|1301|1398|1300|N|Y|Y| 3. 4. SEG|2962|4|A|B|N|000| | |91506|91506|Z|06| 37|0|1|Z|06|37|0|8954| 5. NAME|RIVERSIDE DR| | | |O|E|17

RE: bad name error

2004-10-21 Thread Adamiec, Larry
> > What does "Bad name after question_19_date_one' " mean? I > went thru the > CGI code and the html code and the form names compare OK. > Perldoc does > not have any entry on this topic unless I am looking for the wrong > things. I found this in internet land. Bad name after %s:: (F) Y

tie problem

2004-10-21 Thread Bee
Hi all, I am just about to study about tie, and I've made a very simple test, but don't know what's wrong, would anyone please to point out ? # Mask package Mask; sub TIEHANDLE { my $x; bless \$x; shift } sub PRINT { $_ = $$_[0]; s/./*/g; print} 1; __END__ # main # usuw; use Mask; tie *STD

RE: Help with sprintf and prinf

2004-10-21 Thread A Taylor
Thank you for your help - didnt mean to send the last email so many times - it wont happen again :-) A Do not do that. Please. One copy is plenty. > I am trying to figure out sprint and prinf: what I am trying to do is > format a number into a currency, so 9.9 would be printed as 9.90 > > Can an

Re: Trying to use regex to make multiple change with a code segment

2004-10-21 Thread Dave Gray
> Trying to make a subject line change for a number of scripts, but having no > luck. The original code will have something like: > $MySubject = sprintf "%-s%-s%-s [descriptive Subject] for %-s\n", > $GlblInfo{subjectprefix}, >

bad name error

2004-10-21 Thread Adamiec, Larry
I have a CGI script with 865 lines that I am trying to debug for syntax errors. The top few lines are: #!/usr/local/bin/perl -c # # Title: jd_application.cgi # use strict; use warnings; use CGI; use LWP::UserAgent; use lib '/opt/content/web/www-https/secure-docs/perl-api'; use CCMckDirectLib3_2

Re: Perl / Html

2004-10-21 Thread Chris Devers
On Thu, 21 Oct 2004, Charlene Gentle wrote: > Thanks for the reply. I have a perl script that does things but I > need to make it work on a html form. What "things" does your script do? Did you write it, or are you hoping that we will write it? Did you look at the documentation I referred

RE: How to remove new line chars

2004-10-21 Thread Bob Showalter
Abhishek Dave wrote: > I am stucking with my problem of reading xml file , > I am trying to remove the new line chars form xml file and just > readout the xml tags. If you're trying to parse XML, use an XML parser. http://perl-xml.sourceforge.net/faq/ -- To unsubscribe, e-mail: [EMAIL PROTE

Re: How to remove new line chars

2004-10-21 Thread Willy West
On Thu, 21 Oct 2004 11:23:59 -0400 (EDT), Steve Bertrand <[EMAIL PROTECTED]> wrote: > > I am stucking with my problem of reading xml file , > > I am trying to remove the new line chars form xml file and just > > readout the xml tags. > > > > Please any guys have a look at this one. > > please gu

Re: How to remove new line chars

2004-10-21 Thread Steve Bertrand
> I am stucking with my problem of reading xml file , > I am trying to remove the new line chars form xml file and just > readout the xml tags. > > Please any guys have a look at this one. > please guide me some good stuff abut regex in perl . perldoc perlretut perldoc perlre Have fun! Steve

Re: Help with sprintf and prinf

2004-10-21 Thread Chris Devers
On Thu, 21 Oct 2004, A Taylor wrote: > Date: Thu, 21 Oct 2004 14:34:21 +0100 > From: A Taylor <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] Do not do that. Please. One copy is plenty. > I am trying to figure out sprint and prinf: what I am trying to do is > format a number

Re: need help with upload files.

2004-10-21 Thread Gunnar Hjalmarsson
Anish Kumar K. wrote: I wrote a script to upload one file to one location. The HTML files reads a particular file using and in the form action I have called upload.pl file. in the upload.pl file... $upload_dir = "/home/anish/upload"; $filename = $q->param("filename"); $email_address =

Help with sprintf and prinf

2004-10-21 Thread A Taylor
Hi all, I am trying to figure out sprint and prinf: what I am trying to do is format a number into a currency, so 9.9 would be printed as 9.90 Can anyone give me a simple example of this - i am not having any joy by myself :s Thanks in advance Anadi

Re: Perl / Html

2004-10-21 Thread Charlene Gentle
Hi Thanx for the reply. I have a perl script that does things but I need to make it work on a html form. 1. User enter a word 2. Word get send to the perl script 3. Perl script gets an answer 4. Perl return answer to html 5. Html display answer under the typed in word (on the same page) Thanx

Help with sprintf and prinf

2004-10-21 Thread A Taylor
Hi all, I am trying to figure out sprint and prinf: what I am trying to do is format a number into a currency, so 9.9 would be printed as 9.90 Can anyone give me a simple example of this - i am not having any joy by myself :s Thanks in advance Anadi

Help with sprintf and prinf

2004-10-21 Thread A Taylor
Hi all, I am trying to figure out sprint and prinf: what I am trying to do is format a number into a currency, so 9.9 would be printed as 9.90 Can anyone give me a simple example of this - i am not having any joy by myself :s Thanks in advance Anadi

Help with sprintf and prinf

2004-10-21 Thread A Taylor
Hi all, I am trying to figure out sprint and prinf: what I am trying to do is format a number into a currency, so 9.9 would be printed as 9.90 Can anyone give me a simple example of this - i am not having any joy by myself :s Thanks in advance Anadi

How to remove new line chars

2004-10-21 Thread Abhishek Dave
I am stucking with my problem of reading xml file , I am trying to remove the new line chars form xml file and just readout the xml tags. Please any guys have a look at this one. please guide me some good stuff abut regex in perl . Thanks and Regards, abhishek

Re: Perl / Html / cgi / php /

2004-10-21 Thread JupiterHost.Net
Charlene Gentle wrote: Hi Hello, I would like to know what is the best method and how to use it. I recommend using the CGI module, see search.cpan.org and look for CGI I have a html page with a question. The user submit the question. I want the answer to be sent to a perl script that test it for

Re: Perl / Html / cgi / php /

2004-10-21 Thread Wiggins d Anconia
> Hi > > I would like to know what is the best method and how to use it. > There is no way for us to decide that for you, there are entirely too many factors. > I have a html page with a question. The user submit the question. I > want the answer to be sent to a perl script that test it for

Re: Parsing multiline data

2004-10-21 Thread Bee
> > > > print "Section $_ :\n $sections[$_]\n\n" for @sections; > > > > What are you doing to poor Kevin? > > If you meant: > > print "Section $_:\n $sections[$_]\n\n" for 0..$#sections; > > then I'll forgive you :-) Oops. What a mistake !! Thousands sorry... ( I can't forgive myself )

Re: Parsing multiline data

2004-10-21 Thread David le Blanc
On Thu, 21 Oct 2004 14:55:28 +0800, Bee <[EMAIL PROTECTED]> wrote: > use strict; > > open F, "sourcefile.txt"; > local $/ = "\n\n"; > my @sections = ; > close F; > > print "Section $_ :\n $sections[$_]\n\n" for @sections; > What are you doing to poor Kevin? If you meant: print "Section $_:\n

Re: Perl / Html / cgi / php /

2004-10-21 Thread Chris Devers
On Thu, 21 Oct 2004, Charlene Gentle wrote: > I would like to know what is the best method and how to use it. > > I have a html page with a question. The user submit the question. I > want the answer to be sent to a perl script that test it for stuff, and > the the perl script must send the re

Re: Broken Subroutine

2004-10-21 Thread Gunnar Hjalmarsson
John W. Krahn wrote: Gunnar Hjalmarsson wrote: Here the loop is finished, but nothing is returned from the subroutine. return @basenames; Actually, something IS returned, it is just not something that the OP expects or wants. Yeah, I suppose it returns the null-string. Thanks for the correction. --

Perl / Html / cgi / php /

2004-10-21 Thread Charlene Gentle
Hi I would like to know what is the best method and how to use it. I have a html page with a question. The user submit the question. I want the answer to be sent to a perl script that test it for stuff, and the the perl script must send the result back to the html. The html must display the

need help with upload files.

2004-10-21 Thread Anish Kumar K.
I wrote a script to upload one file to one location. The HTML files reads a particular file using and in the form action I have called upload.pl file. in the upload.pl file... $upload_dir = "/home/anish/upload"; $filename = $q->param("filename"); $email_address = $q->param("email_ad