Re: newbie question for parsing incoming mails

2017-02-16 Thread Jim Gibson
> On Feb 15, 2017, at 9:56 PM, Eko Budiharto wrote: > > Jim, > I have one a couple more questions. > -. For the header, what if, I just need the subject, the from, and the > recipient, what is the command? I read the manual in the >

Re: newbie question for parsing incoming mails

2017-02-15 Thread Eko Budiharto
dear all, I have one a couple questions. -. For the header, what if, I just need the subject, the from, and the recipient, what is the command? I read the manual in the https://metacpan.org/pod/Email::MIME#header , it does not tell me how to extract

Re: newbie question for parsing incoming mails

2017-02-15 Thread Jim Gibson
On Feb 15, 2017, at 7:10 PM, Eko Budiharto wrote: > > Jim, > if I want to extract all incoming emails from my qmail emails, how can > specify the folder location and specify the file name since the file name > always different? > > Thx. Use File::Find or opendir and

Re: newbie question for parsing incoming mails

2017-02-15 Thread Jim Gibson
> On Feb 15, 2017, at 8:10 PM, Eko Budiharto wrote: > > dear Jim, > I tried to add lines to read file like this: > > use Email::MIME; > > my $file = '/var/qmail/mailnames/

Re: newbie question for parsing incoming mails

2017-02-15 Thread Eko Budiharto
dear Jim, I tried to add lines to read file like this: use Email::MIME; my $file = '/var/qmail/mailnames//support/Maildir/cur/1487041394.M984019P23084V0803I00E03878.ABCD.NET,S=3987:2,'; open my $ifh, '<', $file or die "Cannot open '$file' for reading: $!"; local $/ = ''; my

Re: newbie question for parsing incoming mails

2017-02-15 Thread Eko Budiharto
Jim, if I want to extract all incoming emails from my qmail emails, how can specify the folder location and specify the file name since the file name always different? Thx. > On Feb 15, 2017, at 22:56, Jim Gibson wrote: > >> >> On Feb 14, 2017, at 10:38 PM, Eko

Re: newbie question for parsing incoming mails

2017-02-15 Thread Andy Bach
> when I run it, I do not get anything. Hmm, how are you testing it. I put a single header and msg in /tmp/ml.txt (Subject: training.error Trouble wiwb) and: $ parse_email_simple.pl < /tmp/ml.txt training.error Trouble wiwb (8 lines) $ cat /tmp/ml.txt | parse_email_simple.pl training.error Trouble

Re: newbie question for parsing incoming mails

2017-02-15 Thread Jim Gibson
> On Feb 14, 2017, at 10:38 PM, Eko Budiharto wrote: > > dear all, > I have a question. > If I would like to parse all incoming mails from my qmail, which perl module > is easy to use? > my qmail emails incoming is /var/qmail/mailnames//support. In > this folder I

Re: newbie pipe stdin to sendmail

2016-11-03 Thread Mark Coetser
On 02/11/2016 22:14, Andy Bach wrote: #!/usr/bin/perl my $vacation_forward = 'vacat...@domain.com '; open(OUT, "|/usr/sbin/sendmail $vacation_forward") or die ("Can't sendmail - $!"); my $email_addr_to = ''; while ( <>) { $email_addr_to = $1 if /^To: (.*)$/; print

Re: newbie pipe stdin to sendmail

2016-11-02 Thread Mark Coetser
On 02/11/2016 19:35, Andy Bach wrote: On Wed, Nov 2, 2016 at 9:13 AM, Mark Coetser > wrote: $parser->ignore_errors(1); $parser->output_to_core(1); my $entity = $parser->parse(\*STDIN); my $error = ($@ || $parser->last_error);

Re: Newbie creating Perl web report

2014-02-07 Thread Octavian Rasnita
CGI is just an interface between a program and a web server. Other newer interfaces are fastcgi, fcgid, mod_perl, psgi... Using another interface than CGI has some advantages and some disadvantages. The main advantage is that the programs are persistent, so they are ran once, usually when the

Re: Newbie creating Perl web report

2014-02-07 Thread Chankey Pathak
Very good answer Octavian Rasnita :) On Fri, Feb 7, 2014 at 2:00 PM, Octavian Rasnita orasn...@gmail.com wrote: CGI is just an interface between a program and a web server. Other newer interfaces are fastcgi, fcgid, mod_perl, psgi... Using another interface than CGI has some advantages and

Re: Newbie creating Perl web report

2014-02-07 Thread Robert Freiberger
Thank you Octavian, That was an very clear understanding of CGI vs web frame works. I'm still new to the Perl world and will be reading more into the modules you have mentioned. Also greatly welcome any suggestions for tutorials on the subject! Thanks! On Fri, Feb 7, 2014 at 12:45 AM, Chankey

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 4, 2012, at 6:02 PM, David Precious wrote: On Wed, 4 Jul 2012 17:01:35 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: Very nice to know about CPAN. IMO, CPAN is one of Perl's strongest features :) got a syntax error though with your script syntax error at

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 4, 2012, at 5:46 PM, Chris Charley wrote: Phil Pinkerton wrote in message news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... Very nice to know about CPAN. got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near say join Execution of

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread David Precious
On Thu, 5 Jul 2012 09:30:01 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: ok using the example input file I got errors Use of uninitialized value $current_resource in string eq at /Library/Perl/5.12/SVN/Access.pm line 70, ACL line 3. [...] Invalid resource format in ! (format

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 5, 2012, at 10:46 AM, David Precious wrote: On Thu, 5 Jul 2012 09:30:01 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: ok using the example input file I got errors Use of uninitialized value $current_resource in string eq at /Library/Perl/5.12/SVN/Access.pm line 70, ACL line 3.

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 5, 2012, at 10:46 AM, David Precious wrote: On Thu, 5 Jul 2012 09:30:01 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: ok using the example input file I got errors Use of uninitialized value $current_resource in string eq at /Library/Perl/5.12/SVN/Access.pm line 70, ACL line 3.

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 5, 2012, at 10:46 AM, David Precious wrote: On Thu, 5 Jul 2012 09:30:01 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: ok using the example input file I got errors Use of uninitialized value $current_resource in string eq at /Library/Perl/5.12/SVN/Access.pm line 70, ACL line 3.

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Phil Pinkerton
Very nice to know about CPAN. got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near say join Execution of ./getACLinfo.pl aborted due to compilation errors. [code] #!/usr/bin/perl use strict; use SVN::Access; my $acl = SVN::Access-new( acl_file = 'data' ); #

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Chris Charley
Phil Pinkerton wrote in message news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... Very nice to know about CPAN. got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near say join Execution of ./getACLinfo.pl aborted due to compilation errors. [code]

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread David Precious
On Wed, 4 Jul 2012 17:01:35 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: Very nice to know about CPAN. IMO, CPAN is one of Perl's strongest features :) got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near say join Execution of ./getACLinfo.pl

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Phil Pinkerton
Wow I am impressed on the 4th of July no-less I have revision 5 version 14 subversion 2 on linux and v5.12.3 on my mac On Jul 4, 2012, at 5:46 PM, Chris Charley wrote: Phil Pinkerton wrote in message news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... Very nice to know about CPAN.

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Phil Pinkerton
Phil Pinkerton wrote in message news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... Very nice to know about CPAN. got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near say join Execution of ./getACLinfo.pl aborted due to compilation errors.

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-03 Thread David Precious
On Tue, 3 Jul 2012 09:47:00 -0400 Phil Pinkerton pcpinker...@gmail.com wrote: I was given a project that seems to require Perl I could use a sample just to extract a list of names associated with a group or repo and print them. 1) Assigned a task to extract data fron a text file. 2)

Re: Newbie needs help

2011-03-22 Thread shawn wilson
On Tue, Mar 22, 2011 at 1:05 PM, Geospectrum alan.hunt...@geospectrum.co.uk wrote: Hi am am setting up a small website and have set up formmail.pl to create a way of people asking questions. I'd like now to add a way of visitors to display a HTML page by entering a number (invoice number)

Re: Newbie needs help

2011-03-22 Thread Randal L. Schwartz
Geospectrum == Geospectrum alan.hunt...@geospectrum.co.uk writes: Geospectrum Hi am am setting up a small website and have set up formmail.pl to Geospectrum create a way of people asking questions. I'm so very much hoping that you're not using Matt Wright's original formmail.pl, and instead

Re: Newbie queries

2011-01-27 Thread dolphin
On Jan 25, 6:43 pm, orasn...@gmail.com (Octavian Rasnita) wrote: From: dolphin yc282...@yahoo.com.sg Hi, I'm learning perl now and would like to find out how to perform the following if given in a text file? ,12 ,437 ,124 ,45 ,789 ,67 CCC,567

Re: Newbie queries

2011-01-27 Thread Octavian Rasnita
From: dolphin yc282...@yahoo.com.sg Hi, Correct me that the 2 in the following means read? : my ( $label, $value ) = split /,/, $line, 2; 2 means that the result of the split() function will be a list with 2 elements. You could also use the split() function without that third parameter that

Re: Newbie queries

2011-01-25 Thread Octavian Rasnita
From: dolphin yc282...@yahoo.com.sg Hi, I'm learning perl now and would like to find out how to perform the following if given in a text file? ,12 ,437 ,124 ,45 ,789 ,67 CCC,567 DDD,5 How to sum up the 2nd column based on the 1st column with the following result:

Re: Newbie queries

2011-01-25 Thread Mariano Loza Coll
On Tue, Jan 25, 2011 at 2:43 AM, Octavian Rasnita orasn...@gmail.com wrote: From: dolphin yc282...@yahoo.com.sg Hi, I'm learning perl now and would like to find out how to perform the following if given in a text file? ,12 ,437 ,124 ,45 ,789 ,67 CCC,567

Re: Newbie: Perl how evaluate files newer than an hour within ftp

2010-08-18 Thread Shlomi Fish
Hi Atropo, On Tuesday 17 August 2010 15:37:51 Atropo wrote: Hi all, i have this simple script to check if a file has arrive since the last hour find2perl tmp -type f -eval '-M $_ 1/24' -print |perl but now i would like to check in a remote server, maybe on ftp session. i have this

Re: NEWBIE: How to write to a file

2010-06-17 Thread Uri Guttman
A == Atropo lxvasq...@gmail.com writes: A Hi all,don't know almost nothing about perl but I'm RTFM. A Dimitre Radoulov gave a perl script to get and delete via ftp some A files. now i want generate a log file with those file names. A I only added the lines starting in uppercase

Re: Newbie stuck at the first hurdle

2010-04-24 Thread Kryten
Hi Uri, Thanks for the response. I was using both Komodo Edit and Primalscript and didn't see a compile error, until I added the ref to $! then I could see that my filepath was being damaged because of the doublequotes. The reason I wondered about the full path was because I have been using

Re: Newbie stuck at the first hurdle

2010-04-24 Thread Kryten
Thank you Thomas. The problem was indeed the use of a double quoted string which was wrecking my file path. Using the $! var helped me to see that. Learning Perl and Programming Perl both arrived today, thank goodness! Cheers, Stuart -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

Re: Newbie stuck at the first hurdle

2010-04-22 Thread Uri Guttman
K == Kryten kryte...@googlemail.com writes: K All I want to do is read the content of a simple 10 line .txt file K into an array and print out the lines, and I just can't seem to get K it to work! K /* K $target = D:\testfile.txt; K open NEWBIE, $target; that won't even compile.

Re: Newbie stuck at the first hurdle

2010-04-22 Thread Owen
Hi, This is embarrassing. All I want to do is read the content of a simple 10 line .txt file into an array and print out the lines, and I just can't seem to get it to work! /* $target = D:\testfile.txt; open NEWBIE, $target; @arr = WAWA; foreach $line (@arr) { print $line\n; }

Re: newbie question : about the perl sprintf

2009-10-25 Thread Majian
I found these : perl -e'print 01.234 + 01.234', \n' perl -e'print 01.234 + 011.234' \n' perl -e'print 01.234.12 + 01.234', \n' And the results were : 1235234 1235234 1235.12234 Can someone explain it ? Thanks~~ On Sat, Oct 24, 2009 at 7:28 PM, Peter Scott pe...@psdt.com wrote: On Wed, 21

Re: newbie question : about the perl sprintf

2009-10-25 Thread Philip Potter
2009/10/25 Majian jian...@gmail.com: I found these : perl -e'print 01.234 + 01.234', \n' print (01).(234+01).234, \n; this evaluates to '1'.'235'.'234' perl -e'print 01.234 + 011.234' \n' I didn't get 1235234, I got 1243234. print (01).(234+011).(234),\n evaluates to print

Re: newbie question : about the perl sprintf

2009-10-25 Thread Dr.Ruud
Majian wrote: I found these : perl -e'print 01.234 + 01.234', \n' perl -e'print 01.234 + 011.234' \n' perl -e'print 01.234.12 + 01.234', \n' And the results were : 1235234 1235234 1235.12234 For other surprises, try also: perl -wle 'print length(01.234.12)' perl -wle 'print 01.234.12' perl

Re: newbie question : about the perl sprintf

2009-10-24 Thread Peter Scott
On Wed, 21 Oct 2009 20:52:05 +0800, Majian wrote: And I modify it like this sprintf The number in scientific notation is %e, 01.255; The screen now output is The number in scientific notation is 1.255000e+03 Ha, this is an

Re: newbie question : about the perl sprintf

2009-10-22 Thread uap12
On 21 Okt, 14:52, jian...@gmail.com (Majian) wrote: Hi, all ;            I want to print  this sentence The number in scientific notation is 1.255000e+02.          So   I write a perl script like this :                #!/usr/bin/perl                 sprintf The number in scientific

Re: newbie question : about the perl sprintf

2009-10-21 Thread Jim Gibson
At 8:52 PM +0800 10/21/09, Majian wrote: Hi, all ; I want to print this sentence The number in scientific notation is 1.255000e+02. So I write a perl script like this : #!/usr/bin/perl sprintf The number in scientific notation is %e,

Re: newbie question : about the perl sprintf

2009-10-21 Thread Christian Bernini
sprintf The number in scientific notation is %e, 1.255; Sprintf doesn't print actually, it just returns a string based on the formats provided in the list you have. To actually print something you should use printf. printf The number in scientific notation is %e,1255; And the notation

Re: newbie needs help with first perl prog

2009-05-08 Thread John W. Krahn
Prince Mavi wrote: Hi folks Hello, I am new to perl. this is my first real program in perl. The program is not doing what i intend it to do. The problem in nut shell is that: I expect to see the menu first and then input my choice. but the program asks for my choice first and then displays

Re: newbie needs help with first perl prog

2009-05-07 Thread Rhinux.xu
Prince Mavi 写道: Hi folks I am new to perl. this is my first real program in perl. The program is not doing what i intend it to do. The problem in nut shell is that: I expect to see the menu first and then input my choice. but the program asks for my choice first and then displays the menu

Re: newbie needs help with first perl prog

2009-05-07 Thread Steve Bertrand
Prince Mavi wrote: Hi folks I am new to perl. this is my first real program in perl. The program is not doing what i intend it to do. The problem in nut shell is that: I expect to see the menu first and then input my choice. but the program asks for my choice first and then displays the

Re: newbie with a question on syntax

2009-02-04 Thread Dr.Ruud
Chas. Owens wrote: [fat comma] it treats the thing on its left like a string if the thing on the left matches this pattern /^[-_a-zA-Z][-\w]*$/ I don't believe that pattern. So lets test: perl -wle ' $,= = ; my %h = ( -- = x); print %h; ' syntax error at -e line 3, near -- =

Re: newbie with a question on syntax

2009-02-04 Thread Chas. Owens
On Tue, Feb 3, 2009 at 18:32, Dr.Ruud rvtol+use...@isolution.nl wrote: Chas. Owens wrote: [fat comma] it treats the thing on its left like a string if the thing on the left matches this pattern /^[-_a-zA-Z][-\w]*$/ I don't believe that pattern. So lets test: perl -wle ' $,= = ; my

Re: newbie with a question on syntax

2009-02-03 Thread Chas. Owens
On Mon, Feb 2, 2009 at 16:43, Tina tin...@gmail.com wrote: Hello, I just started programming in perl and currently am working in an OOP sort of program. I am writing the constructor and I wasn't sure of the differences between the following syntax: 'count' = 0 @count = 0 Both seem to work

Re: Newbie question about variables, arrays and where they all go

2009-01-19 Thread dolphin_sonar
On Jan 18, 7:54 pm, telemac...@arpinum.org (Telemachus) wrote: On Sun Jan 18 2009 @ 10:59, dolphin_sonar wrote:    1 # When calling 'running_sum(5, 6);' the variable 'state @numbers' receives those two    2 # parameters, (5 and 6), right? Then, the @numbers array also copies/stores (5

Re: Newbie question about variables, arrays and where they all go

2009-01-19 Thread Telemachus
On Mon Jan 19 2009 @ 4:21, dolphin_sonar wrote: Again, you answered my question. You should be teaching Perl as your responses are very clear and that's not easy for people to do...give clear, concise responses. Actually, I had a big goof in my response. The program and the print statement

Re: Newbie question about variables, arrays and where they all go

2009-01-18 Thread Telemachus
On Sun Jan 18 2009 @ 10:59, dolphin_sonar wrote: 1 # When calling 'running_sum(5, 6);' the variable 'state @numbers' receives those two 2 # parameters, (5 and 6), right? Then, the @numbers array also copies/stores (5 and 6) 3 # into the special '( @_ )' variable as well, right? Also,

Re: Newbie question about variables, arrays and where they all go

2009-01-18 Thread Telemachus
From: Telemachus telemac...@arpinum.org Date: Sun, 18 Jan 2009 20:17:27 -0500 To: beginners@perl.org Subject: Re: Newbie question about variables, arrays and where they all go On Sun Jan 18 2009 @ 7:54, Telemachus wrote: The arguments to a subroutine go into the @_ array. The @numbers array

Re: Newbie: Simple conditional on regexp match

2008-08-08 Thread Kenneth Brun Nielsen
On 6 Aug., 16:45, [EMAIL PROTECTED] (Yitzle) wrote: On Wed, Aug 6, 2008 at 4:29 AM, Kenneth Brun Nielsen [EMAIL PROTECTED] wrote: Within a perl program, I want to go to a particular mode when a keyword is found. The keyword is a regexp. E.g. #!/usr/bin/perl -w open FILEHANDLE,

Re: Newbie - Simple conditional on regexp match

2008-08-08 Thread Kenneth Brun Nielsen
On 6 Aug., 14:05, [EMAIL PROTECTED] (Rob Coops) wrote: You are almost right, since it prints all lines all lines match. Could you explain what it is that you are trying to match, that way people might be able to help getting the regex right. i forgot about this thread, since it took so long

Re: Newbie - Simple conditional on regexp match

2008-08-06 Thread Rob Coops
You are almost right, since it prints all lines all lines match. Could you explain what it is that you are trying to match, that way people might be able to help getting the regex right. The way you are looking at the file line by line is valid and if your regex matches only a few lines it will

Re: Newbie - Simple conditional on regexp match

2008-08-06 Thread Rob Dixon
Kenneth Brun Nielsen wrote: I need to make a conditional on a regular expression match. How can I do that? E.g. in the code below, it prints all lines, and NOT only the ones that match. How can I make the boolean test correct? #!/usr/bin/perl -w open FILEHANDLE, soatest.soa; while

Re: Newbie: Simple conditional on regexp match

2008-08-06 Thread yitzle
On Wed, Aug 6, 2008 at 4:29 AM, Kenneth Brun Nielsen [EMAIL PROTECTED] wrote: Within a perl program, I want to go to a particular mode when a keyword is found. The keyword is a regexp. E.g. #!/usr/bin/perl -w open FILEHANDLE, soatest.soa; while (FILEHANDLE){ if (/^\*| XI/) {

Re: newbie question - handling email addresses

2008-05-14 Thread Gunnar Hjalmarsson
Munzilla wrote: i was told that Perl doesn't like the @ character Then you were told wrong. What you need to take into account is that the '@' character in a double quoted string needs to be escaped, or else Perl tries to interpret it as the start of an array variable. As regards data

Re: newbie question - handling email addresses

2008-05-14 Thread Munzilla
Great, thanks. I had hoped that was the case. On May 14, 11:33 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: Munzilla wrote: i was told that Perl doesn't like the @ character Then you were told wrong. What you need to take into account is that the '@' character in a double quoted

Re: Newbie File Question....

2008-02-13 Thread Rob Coops
On a unix/linux file system you see the following: $ ls -la total 244 drwx--9 rcoops ddao24096 Feb 13 09:40 . drwxr-xr-x 39 root root 4096 Feb 11 13:23 .. -rw---1 rcoops ddao2 158310 Feb 13 09:40 .bash_history -rw-r--r--1 rcoops ddao2

Re: Newbie File Question....

2008-02-13 Thread Kashif Salman
On Feb 13, 2008 8:34 AM, [EMAIL PROTECTED] wrote: I've been going over some listings and I found code like the following: ./directory/file.txt and ../directory/file.txt but I've never seen the ./ and ../ things at the beginning of the path. I've tried to google these but had no

Re: Newbie File Question....

2008-02-13 Thread Michael Barnes
[EMAIL PROTECTED] told me on 02/13/2008 10:34 AM: I've been going over some listings and I found code like the following: ./directory/file.txt and ../directory/file.txt but I've never seen the ./ and ../ things at the beginning of the path. I've tried to google these

Re: Newbie File Question....

2008-02-13 Thread MK
On 02/13/2008 11:34:56 AM, [EMAIL PROTECTED] wrote: - I've been going over some listings and I found code - - like the following: - - - - ./directory/file.txt and - - ../directory/file.txt this is not really a perl question, but since perl does respect the reference: . and .. are relative

Re: Newbie File Question....

2008-02-13 Thread David Moreno
On Feb 13, 2008 12:30 PM, [EMAIL PROTECTED] wrote: Thank you to all who replied to this requestnow I understand! I appreciate the help and the courtesy of the replies! Once againThank You!! One more satisfied customer -said somewhere sometime by merlyn. -- David Moreno -

RE: Newbie File Question....

2008-02-13 Thread Richard.Copits
Thank you to all who replied to this requestnow I understand! I appreciate the help and the courtesy of the replies! Once againThank You!! -Original Message- From: Copits Dick Sent: Wednesday, February 13, 2008 11:35 AM To: beginners@perl.org Subject: Newbie File Question

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-02-04 Thread axtens
On Feb 4, 12:44 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: axtenswrote: On Feb 1, 10:00 am, [EMAIL PROTECTED] (Rob Dixon) wrote: axtenswrote: G'day everyone John As it happens, there are commas in the data, and they can be on either side of the the tab. What's more, I wanted to be able

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-02-04 Thread John W. Krahn
John W. Krahn wrote: axtens wrote: On Feb 4, 12:44 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: axtens wrote: $res =~ s/\^/FS/ge; The /e option evaluates the FS string as perl code but it is not perl code so why use the /e option? As for the /e with the FS, the FS is actually a

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-02-04 Thread John W. Krahn
axtens wrote: On Feb 4, 12:44 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: axtens wrote: $res =~ s/\^/FS/ge; The /e option evaluates the FS string as perl code but it is not perl code so why use the /e option? As for the /e with the FS, the FS is actually a constant for chr(28) which

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-02-04 Thread axtens
On Feb 4, 9:11 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: John W. Krahn wrote: axtenswrote: On Feb 4, 12:44 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: John, You're blowing me away with all this kindness. Thanks. Bruce. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-02-03 Thread axtens
On Feb 1, 10:00 am, [EMAIL PROTECTED] (Rob Dixon) wrote: axtenswrote: G'day everyone Thanks for that. I did, however, give up on using TwoWay and used an idea a colleague had given me, as below: sub Misspellings_Setup { @wordsList = split /\n/, '__WORDLIST__' abandonned abandoned

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-02-03 Thread John W. Krahn
axtens wrote: On Feb 1, 10:00 am, [EMAIL PROTECTED] (Rob Dixon) wrote: axtenswrote: G'day everyone Thanks for that. I did, however, give up on using TwoWay and used an idea a colleague had given me, as below: sub Misspellings_Setup { @wordsList = split /\n/, '__WORDLIST__' abandonned

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-01-31 Thread Rob Dixon
axtens wrote: G'day everyone I'm confused. I'm trying to make use of Tie::Hash::TwoWay to give me access to a dictionary of word = misspelling. Has anyone got any idea how I would use TwoWay for this? Nothing I do seems to work. my $secondary = $dict-{0}; while ( ($k, $v) = ( each

Re: Newbie: Has anyone used Tie::Hash::TwoWay

2008-01-31 Thread Rob Dixon
axtens wrote: G'day everyone I'm confused. I'm trying to make use of Tie::Hash::TwoWay to give me access to a dictionary of word = misspelling. Has anyone got any idea how I would use TwoWay for this? Nothing I do seems to work. my $secondary = $dict-{0}; while ( ($k, $v) = ( each

Re: Newbie question on substitution with Subroutines

2007-10-25 Thread Paul Lalli
On Oct 25, 12:01 pm, [EMAIL PROTECTED] (Minky Arora) wrote: I need to make multiple substitutions in a file.There could be a situation where there are more than one substitution on a single line.I want to count the total # of substituitions.I need to use subroutines: Says who? Is this a

Re: Newbie question on substitution with Subroutines

2007-10-25 Thread Dr.Ruud
minky arora schreef: my ($count,$count1,$count3,$count2); Consider: my @count; -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Newbie

2006-10-15 Thread Darwin Pintado
Thanks Romeo for the heads up! --- Romeo Theriault [EMAIL PROTECTED] wrote: Perl is cross-platform, extremely useful for working with large amounts of text, using regular expressions, it has a great repository of modules for you to use for just about any task you can think of

Re: Newbie

2006-10-13 Thread Romeo Theriault
Perl is cross-platform, extremely useful for working with large amounts of text, using regular expressions, it has a great repository of modules for you to use for just about any task you can think of (CPAN), it's open source, it's got a great community, the list goes on and on. I would

RE: Newbie Question

2006-09-20 Thread M K Scott
/09/2006 01:12 To: Perl Beginners Subject: Re: Newbie Question M K Scott wrote: Hi all, Hello, Please forgive the newbie nature of this question but i'm just starting off teaching myself perl from scratch and so need a little clarification. I am trying to put together a script to do

RE: Newbie Question

2006-09-20 Thread Lee Goddard
references to the numbers and then add one to a count but is this the best way to do this? Thanks again, Mark From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Wed 20/09/2006 01:12 To: Perl Beginners Subject: Re: Newbie Question M K Scott wrote

Re: Newbie Question

2006-09-20 Thread John W. Krahn
M K Scott wrote: Hi, Hello, I have tried that to no avail. I have also tried a simple match of !~ m/(m|f){1}/ and even put in the code you suggested to read !~ m/^(m|f){1}$/ but this still doesn't work properly. Input of d or T will work to say it is incorrect and input of m or f will

RE: Newbie Question

2006-09-20 Thread M K Scott
/2006 17:07 To: Perl Beginners Subject: Re: Newbie Question M K Scott wrote: Hi, Hello, I have tried that to no avail. I have also tried a simple match of !~ m/(m|f){1}/ and even put in the code you suggested to read !~ m/^(m|f){1}$/ but this still doesn't work properly. Input of d or T

Re: Newbie Question

2006-09-19 Thread Igor Sutton
while ($string != m/[a-zA-Z]{1,5}/ ) { print(that is wrongtry again: ); chomp ($string = STDIN); } Maybe: while ($string !~ m/.../) { ... } When you're matching against regular expressions, you need to use =~ or !~. Hope this helps. -- Igor Sutton Lopes t: +55 51

Re: Newbie Question

2006-09-19 Thread John W. Krahn
M K Scott wrote: Hi all, Hello, Please forgive the newbie nature of this question but i'm just starting off teaching myself perl from scratch and so need a little clarification. I am trying to put together a script to do pattern matching and while I can get the basic syntax alright it

Re: Newbie Perl Question

2006-07-17 Thread Dr.Ruud
Rod Burgess schreef: Your Subject has no quality. Please come up with something like convert data lines. I am new to the Perl world and am trying to learn it. A coworker tells me that Perl will not work for what I am trying to do however, I think Perl would be a great tool to use and I feel

Re: Newbie Perl Question

2006-07-17 Thread Todd W
Rod Burgess [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am new to the Perl world and am trying to learn it. A coworker tells me that Perl will not work for what I am trying to do however, I think Perl would be a great tool to use and I feel this coworker is wrong. I have a

Re: Newbie Perl Question

2006-07-17 Thread Maxim
Hello Rod, I am not the author of the initial message, but thanks a lot for your reply. I am trying to adopt your script to my need, and, basically, it works for me. But I am totally frustrated in regexp part in the script: /^DR\d+.*?(\d+).*?(\d+)(.+)/ Could you please explain it? Or maybe you

Re: Newbie Perl Question

2006-07-17 Thread Rob Dixon
Rod Burgess wrote: I am new to the Perl world and am trying to learn it. A coworker tells me that Perl will not work for what I am trying to do however, I think Perl would be a great tool to use and I feel this coworker is wrong. I have a file that contains several lines all as below:

Re: Newbie Perl Question

2006-07-17 Thread Peter Hoose
I'm pretty new myself, as such I like to see a little more error checking to accomodate for mine (or other people's) mistakes, here's one similar to Rob's but with some additional error checking that you might want, basically the main difference is that it expects your lines to be formatted

Re: Newbie Perl Question

2006-07-17 Thread Peter Cornelius
On Jul 17, 2006, at 11:33 AM, Maxim wrote: But I am totally frustrated in regexp part in the script: /^DR\d+.*?(\d+).*?(\d+)(.+)/ Could you please explain it? Or maybe you have a link to intelligible guide for perl regexp? perldoc perlre is a pretty detailed description of perl's regexp.

Re: newbie sort question

2006-04-03 Thread Val Genova
thanks this solved my problem my @output_sorted = sort { (split /,/, $b)[0] = (split /,/, $a)[0] } @output; thanks to all that helped Jeff Pang [EMAIL PROTECTED] writes: this is my friend's script # collect all score my @output = (); my @old_output = (); foreach my $list

Re: newbie sort question

2006-03-23 Thread Jeff Pang
this is my friend's script # collect all score my @output = (); my @old_output = (); foreach my $list (@bugkillers) { my ($id,$name) = split(/,/, $list); my $score = $Bugs-getSCORE($showold,$id,$contest,$pContest,$groups); push(@output,$score,$id,$name);

Re: newbie needs help on hidden and CGI parameters

2006-03-09 Thread Sean Davis
You realize that hidden fields are not hidden, right? You just have to view the source of the page in which they are embedded and you now know the username and password, and that with every round-trip to the server, this information is sent in plain-text (unless you are using SSL)? I would read

Re: newbie question about print header

2006-03-08 Thread Bill Stephenson
From the CGI.pm docs... Most browsers will not cache the output from CGI scripts. Every time the browser reloads the page, the script is invoked anew. You can change this behavior with the -expires parameter. When you specify an absolute or relative expiration interval with this parameter,

Re: newbie help for podcast script [with attach]

2005-07-31 Thread John Doe
[...] The script works fine for a normal pod feed. It only fails when the feed only has one channel-item. Is line 65 OK? foreach my $item (@{$data-{channel}-{item}}) { all I want to do is step through one-by-one each item. Does that code work properly if there is only one item instead of

Re: newbie help for podcast script [with attach]

2005-07-31 Thread alexeijh
On Sat, 2005-07-30 at 20:15 +1000, [EMAIL PROTECTED] wrote: On Fri, 2005-07-29 at 19:03 -0700, John W. Krahn wrote: You are trying to call the get() method on the $feed object. Read the documentation for the correct syntax for XML::Simple::XMLin(). perldoc XML::Simple As to

RE: newbie help for podcast script [with attach]

2005-07-31 Thread Charles K. Clarkson
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: : This is basically my 1st perl script. : : It's a podcast download app. I don't know the etiquette for : attaching files, but I have attached a 100 line perl file. : : It seems that it fails if there is only 1 podcast for a feed : with: : :

Re: newbie help for podcast script [with attach]

2005-07-30 Thread alexeijh
On Fri, 2005-07-29 at 19:03 -0700, John W. Krahn wrote: You are trying to call the get() method on the $feed object. Read the documentation for the correct syntax for XML::Simple::XMLin(). perldoc XML::Simple As to the warning message: perldoc perldiag [snip] Odd number of

Re: newbie help for podcast script [with attach]

2005-07-29 Thread John W. Krahn
[EMAIL PROTECTED] wrote: *** SORRY, forgot to attach file. *** Hi, Hello, This is basically my 1st perl script. It's a podcast download app. I don't now the etiquette for attaching files, but I have attached a 100 line perl file. It seems that it fails if there is only 1 podcast for

  1   2   3   4   5   >