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 > https://metacpan.org/pod/Email::MIME#header, it does not tell

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 readdir to find all of th

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/ name>/support/Maildir/cur/1487041394.M984019P23084V0803I00E03878.ABCD.NET,S=3987:2,'; > open my $ifh,

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 Budiharto wrote: >> >> dear

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 already have preline in .qma

newbie question for parsing incoming mails

2017-02-14 Thread Eko Budiharto
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 already have preline in .qmail for piping emails to my perl script. And, my perl script what I alread

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread Brandon McCaig
On Sat, Oct 2, 2010 at 11:40 AM, "jobst müller" wrote: > Hello Alex > > many thanks for the answer. > > well i put all to home > usr > perl /home/usr is a pretty strange path. Typically, the subdirectories of /home represent individual users' "home directory". For example, /home/jmüller, or /home

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread Jim Gibson
At 5:40 PM +0200 10/2/10, jobst müller wrote: Hello Alex many thanks for the answer. well i put all to home > usr > perl Please trim your replies and eliminate old material that is not relevant. Thanks. So here we go: i start them in the console like the following and get the following

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread jobst müller
directory at /usr/lib/perl5/site_perl/5.12.1/File/Find/Rule.pm line 594 i go crazy - what is wrong here!? Love to hear from you best regards -Ursprüngliche Nachricht- Von: "Alexey Mishustin" Gesendet: 02.10.2010 13:27:23 An: beginners@perl.org Betreff: Re: pat

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread Alexey Mishustin
2.10.2010, 15:22:03, Alexey Mishustin wrote: > 2.10.2010, 13:57:54, "jobst müller" wrote: >> #!/usr/bin/perl >> use strict; >> use warnings; >> use diagnostics; >> use File::Find::Rule; >> my @files = File::Find::Rule->file() >> ->name('*.html') >> ->in( 'home/usr/perl/html.files' ); ->in( '

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread Alexey Mishustin
2.10.2010, 13:57:54, "jobst müller" wrote: > #!/usr/bin/perl > use strict; > use warnings; > use diagnostics; > use File::Find::Rule; > my @files = File::Find::Rule->file() > ->name('*.html') > ->in( 'home/usr/perl/html.files' ); ->in( '/home/usr/perl/html.files' ); > foreach my $file(@files

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread jobst müller
ove to hear from you and appreciate any and all help! martin aka  floobee -Ursprüngliche Nachricht- Von: "Jim Gibson" Gesendet: 02.10.2010 02:44:54 An: beginners@perl.org Betreff: Re: path names in a perl-script: a newbie-question >At 1:29 AM +0200 10/2/10, jobst müller wrot

Re: path names in a perl-script: a newbie-question

2010-10-01 Thread Jim Gibson
At 1:29 AM +0200 10/2/10, jobst müller wrote: Hi all i am new to the list! i am new to Linux and new to PERL too. I am trying to get this perl script up and running. I have installed OpenSuse-Linux 11.3 What is wanted: I have a bunch of HTML-files, stored in a folder. with the Perl-Script

path names in a perl-script: a newbie-question

2010-10-01 Thread jobst müller
Hi all i am new to the list! i am new to Linux and new to PERL too. I am trying to get this perl script up and running. I have installed OpenSuse-Linux 11.3 What is wanted: I have a bunch of HTML-files, stored in a folder. with the Perl-Script (see below) i want to parse the HTML-files. I ha

Re: Real newbie question

2010-07-22 Thread Scott Hall
On Thu, Jul 22, 2010 at 2:34 AM, Dr.Ruud > wrote: > Jim Gibson wrote: > >> scribbled: >> > > I have a multi line text file laid out as below. >>> >>> 10.10.10.45 bobs >>> 10.10.10.34 jims >>> 10.10.10.27 jacks >>> >>> I would like to that the 10.10.10.??? and move it to the end of the same >>>

Re: Real newbie question

2010-07-22 Thread Uri Guttman
> "CD" == C DeRykus writes: CD> On Jul 21, 3:42 pm, u...@stemsystems.com ("Uri Guttman") wrote: >> >>         perl -pe 's/(\S+)\s+(\S+)/$2 $1/' file >> CD> Since the weather's good for golf... i was vaguely hinting at golf but i wanted a fairly normal looking solution as well!

Re: Real newbie question

2010-07-22 Thread C.DeRykus
On Jul 21, 3:42 pm, u...@stemsystems.com ("Uri Guttman") wrote: > > "JG" == Jim Gibson writes: > >   JG> On 7/21/10 Wed  Jul 21, 2010  11:51 AM, "Vaughan Williams" >   JG> scribbled: > >   >> Hi all, >   >> >   >> I'm hope you all could help me with a very simple question. >   >> >   >> I hav

Re: Real newbie question

2010-07-22 Thread Dr.Ruud
Jim Gibson wrote: scribbled: I have a multi line text file laid out as below. 10.10.10.45 bobs 10.10.10.34 jims 10.10.10.27 jacks I would like to that the 10.10.10.??? and move it to the end of the same line so the output will look like. bobs 10.10.10.45 jims 10.10.10.34 jacks 10.10.10.27

Re: Real newbie question

2010-07-22 Thread C.DeRykus
On Jul 21, 12:05 pm, jimsgib...@gmail.com (Jim Gibson) wrote: > On 7/21/10 Wed  Jul 21, 2010  11:51 AM, "Vaughan Williams" > scribbled: > >> ... > > > bobs 10.10.10.45 > > jims 10.10.10.34 > > jacks 10.10.10.27 > > . > > . > > perl -ane 'print join(" ",reverse(@F)),"\n"' file A variant us

Re: Real newbie question

2010-07-21 Thread Uri Guttman
> "JG" == Jim Gibson writes: JG> On 7/21/10 Wed Jul 21, 2010 11:51 AM, "Vaughan Williams" JG> scribbled: >> Hi all, >> >> I'm hope you all could help me with a very simple question. >> >> I have a multi line text file laid out as below. >> >> 10.10.10.45 bobs >> 10.

Re: Real newbie question

2010-07-21 Thread Uri Guttman
> "M" == Matt writes: M> Perl 1: Introduction to Perl M> http://www.oreillyschool.com/courses/perl1/ M> Online Course, Pricy but very good. i will second that as i know the author very well. level 2 will be out pretty soon. there will be 4 levels at least. these are not kiddie tutoria

Re: Real newbie question

2010-07-21 Thread Shlomi Fish
On Wednesday 21 Jul 2010 22:16:38 Vaughan Williams wrote: > Hi Uri, Jim, > > Thanks for the help, it is a very small file some 8kB in size. > > Jim's supplied command worked perfectly, although I really do not > understand it being a 1 day old perl "want-a-be" LOL > > I guess have allot of learn

Re: Real newbie question

2010-07-21 Thread Matt
> I guess have allot of learning to do, can anyone suggest a good starting > point books or online courses for true newbies. Learning Perl, Fifth Edition http://oreilly.com/catalog/9780596520113/ Best beginning Perl book. Perl Cookbook is great for examples as well. Perl 1: Introduction to Perl

Re: Real newbie question

2010-07-21 Thread Vaughan Williams
Hi Uri, Jim, Thanks for the help, it is a very small file some 8kB in size. Jim's supplied command worked perfectly, although I really do not understand it being a 1 day old perl "want-a-be" LOL I guess have allot of learning to do, can anyone suggest a good starting point books or online course

Re: Real newbie question

2010-07-21 Thread Uri Guttman
> "VW" == Vaughan Williams writes: VW> Hi all, VW> I'm hope you all could help me with a very simple question. VW> I have a multi line text file laid out as below. VW> 10.10.10.45 bobs VW> 10.10.10.34 jims VW> 10.10.10.27 jacks VW> . VW> . VW> I would like to that

Re: Real newbie question

2010-07-21 Thread Jim Gibson
On 7/21/10 Wed Jul 21, 2010 11:51 AM, "Vaughan Williams" scribbled: > Hi all, > > I'm hope you all could help me with a very simple question. > > I have a multi line text file laid out as below. > > 10.10.10.45 bobs > 10.10.10.34 jims > 10.10.10.27 jacks > . > . > > I would like to

Real newbie question

2010-07-21 Thread Vaughan Williams
Hi all, I'm hope you all could help me with a very simple question. I have a multi line text file laid out as below. 10.10.10.45 bobs 10.10.10.34 jims 10.10.10.27 jacks . . I would like to that the 10.10.10.??? and move it to the end of the same line so the output will look like. bobs

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'

Re: newbie question : about the perl sprintf

2009-10-25 Thread Philip Potter
2009/10/25 Majian : > 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 '1'.(234+9).'234',"\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 wrote: > On Wed, 21 Oct 200

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 scienti

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 notatio

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", 1.

newbie question : about the perl sprintf

2009-10-21 Thread Majian
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", 1.255; But the screen output is "

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-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/sto

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

2009-01-18 Thread Telemachus
From: Telemachus 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 is > empty unt

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? A

Newbie question about variables, arrays and where they all go

2009-01-18 Thread dolphin_sonar
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, line 13 pushes '$number' into 4 # the '@numbers' ar

Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-16 Thread dolphin_sonar
On Jan 15, 7:39 am, telemac...@arpinum.org (Telemachus) wrote: > On Wed Jan 14 2009 @  8:17, dolphin_sonar wrote: > > > > > Hi, > > > I bought the O'Reilly 5th edition Learning Perl the other day and it's > > great. I am new to programming and Perl as well. I do know my way > > around Linux but I a

Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-15 Thread Telemachus
On Wed Jan 14 2009 @ 8:17, dolphin_sonar wrote: > Hi, > > I bought the O'Reilly 5th edition Learning Perl the other day and it's > great. I am new to programming and Perl as well. I do know my way > around Linux but I am having problems upgrading from the version that > was on my OS (Cent OS 5.2)

Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-15 Thread dolphin_sonar
Hi, I bought the O'Reilly 5th edition Learning Perl the other day and it's great. I am new to programming and Perl as well. I do know my way around Linux but I am having problems upgrading from the version that was on my OS (Cent OS 5.2) to 5.10. I downloaded Perl 5.10 from http://www.cpan.org/aut

Re: A newbie question - line number inside the script

2008-07-17 Thread Amit Koren
Amit, Thank you for the quick response. What i actually meant was the line number of the source-script file, that is now being read (executed). This is achieved (so i learned from the list) by the __LINE__ directive. Thanks again. Amit. On Wed, Jul 16, 2008 at 1:24 PM, Amit Saxena <[EMAIL PROTE

Re: A newbie question - line number inside the script

2008-07-16 Thread Peter Aronoff
Hi Stewart, Is there *anything* that might convince you to stop top-posting? Let me put it another way: please stop top-posting. Thanks. signature.asc Description: Digital signature

Re: A newbie question - line number inside the script

2008-07-16 Thread Rob Dixon
Amit Koren wrote: > > I'm a newbie to Perl, (and to this mailing list) :) > There's a task i was given, in which it is necessary to get the > number of the current executing line/command - inside the script itself. > > Can someone assist please ? The value of __LINE__ is the source file line

RE: A newbie question - line number inside the script

2008-07-16 Thread V.Ramkumar
Just use $. To print current line number. Regards, Ramkumar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: A newbie question - line number inside the script

2008-07-16 Thread Stewart Anderson
al Message- From: Amit Koren [mailto:[EMAIL PROTECTED] Sent: 16 July 2008 11:22 To: beginners@perl.org Subject: A newbie question - line number inside the script Hi list. I'm a newbie to Perl, (and to this mailing list) :) There's a task i was given, in which it is necessary to

RE: A newbie question - line number inside the script

2008-07-16 Thread Stewart Anderson
You could use the __LINE__ directive in your error handler. -Original Message- From: Amit Saxena [mailto:[EMAIL PROTECTED] Sent: 16 July 2008 11:25 To: Amit Koren Cc: beginners@perl.org Subject: Re: A newbie question - line number inside the script On Wed, Jul 16, 2008 at 3:52

Re: A newbie question - line number inside the script

2008-07-16 Thread Amit Saxena
On Wed, Jul 16, 2008 at 3:52 PM, Amit Koren <[EMAIL PROTECTED]> wrote: > Hi list. > > I'm a newbie to Perl, (and to this mailing list) :) > There's a task i was given, in which it is necessary to get the > number of the current executing line/command - inside the script itself. > > Can someone as

A newbie question - line number inside the script

2008-07-16 Thread Amit Koren
Hi list. I'm a newbie to Perl, (and to this mailing list) :) There's a task i was given, in which it is necessary to get the number of the current executing line/command - inside the script itself. Can someone assist please ? Thanks in advance, Amit.

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 > q

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 fr

newbie question - handling email addresses

2008-05-14 Thread Munzilla
Hi, I'm 100% new to Perl but I've been given a project with it anyway, so I have some pretty basic questions. The script is used to process a form submitted in PHP. I have it working fine, but I need to add an email address field now. i was told that Perl doesn't like the "@" character (which mak

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 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 h

Newbie question on substitution with Subroutines

2007-10-25 Thread minky arora
Hi Team, 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: I have 3 questions: 1) Do I have to make 3 separate Regex.How can it be done in

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

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

RE: Newbie Question

2006-09-20 Thread Lee Goddard
s 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: &g

RE: Newbie Question

2006-09-20 Thread M K Scott
ay 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: > Hi all, Hello, > Please forgive the newbie nature of this question but i'm

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 alrigh

Re: Newbie Question

2006-09-19 Thread Igor Sutton
while ($string != m/[a-zA-Z]{1,5}/ ) { print("that is wrongtry again: "); chomp ($string = ); } 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 9627.0779 e:

Newbie Question

2006-09-19 Thread M K Scott
Hi all, 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 doesn't seem to be working as e

CPAN Newbie Question

2006-07-05 Thread Colin Segovis
I have problems building CPAN on my Debian box. When I run the command: cpan> install Bundle::CPAN the following error message is returned at the bottom of the verbose information presented during the install/build: Running install for module Term::ReadKey Running make for J/JS/JSTOWE/TermRead

RE: Please Help!!! Newbie Question

2005-09-01 Thread Bakken, Luke
Perl wrote: > Hi List, > > I have this script which actually returns the value of the filename > with extension but If the file name is something like > "c:\projects\text 009.txt" (having a space in filename which is > common in windows). > This script only returns "text" instead of returning ful

Re: Please Help!!! Newbie Question

2005-09-01 Thread Randy W. Sims
Perl wrote: Hi List, I have this script which actually returns the value of the filename with extension but If the file name is something like "c:\projects\text 009.txt" (having a space in filename which is common in windows). This script only returns "text" instead of returning full name of fil

Please Help!!! Newbie Question

2005-09-01 Thread Perl
Hi List, I have this script which actually returns the value of the filename with extension but If the file name is something like "c:\projects\text 009.txt" (having a space in filename which is common in windows). This script only returns "text" instead of returning full name of file. Here is the

Re: Please Help!!! Newbie question

2005-08-31 Thread Eric Walker
On Wednesday 31 August 2005 09:12 am, Perl wrote: > I am new to perl so I need some help from the list with this script. It > takes a value from command line and then returns afters processing. > For example, If value is "c:\projects\test 2005.txt" the script will > returns it as "test" (actually o

RE: Please Help!!! Newbie question

2005-08-31 Thread Bakken, Luke
Perl wrote: > I am new to perl so I need some help from the list with this script. > It takes a value from command line and then returns afters processing. > For example, If value is "c:\projects\test 2005.txt" the script will > returns it as "test" (actually omitts any space in the directory or >

Please Help!!! Newbie question

2005-08-31 Thread Perl
I am new to perl so I need some help from the list with this script. It takes a value from command line and then returns afters processing. For example, If value is "c:\projects\test 2005.txt" the script will returns it as "test" (actually omitts any space in the directory or file name) while I wan

Re: perl newbie question

2005-07-26 Thread Jay Savage
On 7/25/05, FreeFall <[EMAIL PROTECTED]> wrote: > try: > perl -ne '$line=$_;END{print $line}' yourfile > > On Mon, 25 Jul 2005 19:09:50 +0530 > [EMAIL PROTECTED] wrote: > > > > > hi , > > I am a perl newbie. > > Can someone suggest a perl command line snippet that will print the last n >

Re: perl newbie question

2005-07-25 Thread FreeFall
try: perl -ne '$line=$_;END{print $line}' yourfile On Mon, 25 Jul 2005 19:09:50 +0530 [EMAIL PROTECTED] wrote: > > hi , > I am a perl newbie. > Can someone suggest a perl command line snippet that will print the last n > lines of a file. > > thanks in advance. > regards, > Kaushik > >

Re: perl newbie question

2005-07-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > hi , Hello, > I am a perl newbie. > Can someone suggest a perl command line snippet that will print the last n > lines of a file. perl -ne'INIT{$#x=shift()[EMAIL PROTECTED](splice(@x,1),$_)[EMAIL PROTECTED]' 4 yourfile John -- To unsubscribe, e-mail: [EM

RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Dave Adams wrote: > Larsen, > Hi Dave. My name is Errin. Larsen is my surname. Please, when posting replies, post to the list. > I am afraid I cannot get your suggested code to work. Especially > line that reads "foreach reverse 0..$n;" > > On 7/25/05, Larsen, Errin M HMMA/Information

Re: perl newbie question

2005-07-25 Thread Jeff 'japhy' Pinyan
On Jul 25, [EMAIL PROTECTED] said: Can someone suggest a perl command line snippet that will print the last n lines of a file. The File::ReadBackwards module does it for you rather simply. -- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % th

Re: perl newbie question

2005-07-25 Thread Matthias Ochs
[EMAIL PROTECTED] wrote: hi , I am a perl newbie. Can someone suggest a perl command line snippet that will print the last n lines of a file. Why do you want a Perl line for that? You could just use 'tail' (assuming you run some kind of UNIX). Matthias -- To unsubscribe, e-mail: [E

RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Edward WIJAYA wrote: > On Mon, 25 Jul 2005 21:39:50 +0800, <[EMAIL PROTECTED]> wrote: > > >> Can someone suggest a perl command line snippet that will print the >> last n >> lines of a file. > > > If you are under unix/linux > just use "tail -n" command. > > However if you really want to go vi

Re: perl newbie question

2005-07-25 Thread Keith Worthington
hi , I am a perl newbie. Can someone suggest a perl command line snippet that will print the last n lines of a file. thanks in advance. regards, Kaushik Kaushik, If you are on the command line I suggest the use of the tail command. tail -n 123 filename If you must perform this oper

Re: perl newbie question

2005-07-25 Thread Edward WIJAYA
On Mon, 25 Jul 2005 21:39:50 +0800, <[EMAIL PROTECTED]> wrote: Can someone suggest a perl command line snippet that will print the last n lines of a file. If you are under unix/linux just use "tail -n" command. However if you really want to go via Perl command line: $perl -e ' open FH, "

perl newbie question

2005-07-25 Thread kaushik . m
hi , I am a perl newbie. Can someone suggest a perl command line snippet that will print the last n lines of a file. thanks in advance. regards, Kaushik Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information.

Re: newbie question about regex

2004-09-03 Thread David Dorward
On Fri, Sep 03, 2004 at 04:33:43PM +0200, Maurice Lucas wrote: > $ ./count.pl /var/log/file text > this works fine but sometimes the "text" is "foo(bar)" and then my scripts > gives an error. > syntax error near unexpected token `foo(b' That's a shell issue, not a Perl issue. Escape your brackets

Re: newbie question about regex

2004-09-03 Thread Maurice Lucas
Hello, I call my script with the following line $ ./count.pl /var/log/file text this works fine but sometimes the "text" is "foo(bar)" and then my scripts gives an error. syntax error near unexpected token `foo(b' I believe the syntax error is from your shell and you can get around this by quoting

Re: newbie question about regex

2004-09-03 Thread Wiggins d Anconia
> Hello, > > I call my script with the following line > $ ./count.pl /var/log/file text > this works fine but sometimes the "text" is "foo(bar)" and then my scripts > gives an error. > syntax error near unexpected token `foo(b' > I believe the syntax error is from your shell and you can get ar

newbie question about regex

2004-09-03 Thread Maurice Lucas
Hello, I call my script with the following line $ ./count.pl /var/log/file text this works fine but sometimes the "text" is "foo(bar)" and then my scripts gives an error. syntax error near unexpected token `foo(b' Could somebody give me a hint? I'm working on linux My script #!/usr/bin/perl

Re: Newbie question

2004-08-03 Thread Paul Kraus
Go to a command prompt.Type ppm hit enter. use this tool to install modules of windows. On Sat, Jul 31, 2004 at 11:22:37PM -0500, Drue Reeves wrote: > Sorry for the newbie question but, I'm having trouble using the Perldap > module. I downloaded the binaries and I am trying to instal

Newbie question

2004-08-02 Thread Drue Reeves
Sorry for the newbie question but, I'm having trouble using the Perldap module. I downloaded the binaries and I am trying to install them into ActiveState's latest version of Perl for Windows. I put the contents of blib/lib/Mozilla from the zip file in the Perl/lib directory (where the r

newbie question: need help reading input into variable

2004-06-09 Thread CM Analyst
Dear experts. I need help..the script below fails to apply the user supplied value to the file in question. I think the problem is because the $String variable is not getting the user supplied value. If my assumption is correct, can some one please show me how to do that? I am very new to scrip

RE : Perl Newbie Question

2004-05-18 Thread Jose Nyimi
> -Message d'origine- > De : Perl Mail User [mailto:[EMAIL PROTECTED] > Envoyé : mardi 18 mai 2004 20:10 > À : [EMAIL PROTECTED] > Objet : Perl Newbie Question > > Hello All, > > I have a question, I am looking to read the name of the file that I am >

Re: Perl Newbie Question

2004-05-18 Thread Paul Johnson
On Tue, May 18, 2004 at 01:10:27PM -0500, Perl Mail User wrote: > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part of > the script. $ARGV perldoc perlvar -- Paul Johnson - [EMAIL PROTECTED] http://

RE: Perl Newbie Question

2004-05-18 Thread Bob Showalter
Perl Mail User wrote: > Hello All, Hi. Providing a real name would be considered polite. Also, please choose a meaningful subject. > > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part > of > the script

Re: Perl Newbie Question

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 1:10 PM, Perl Mail User wrote: Hello All, I have a question, I am looking to read the name of the file that I am passing as an argument to the perl script through the while (<>) part of the script. You're looking for the $ARGV variable. It contains the filename you need. Hop

Perl Newbie Question

2004-05-18 Thread Perl Mail User
Hello All, I have a question, I am looking to read the name of the file that I am passing as an argument to the perl script through the while (<>) part of the script. Example: perl script.pl 1.txt 2.txt 3.txt Each file has information that I am parsing to put into a report but I need to get th

RE: An extremely newbie question about appending records in a fil e.

2004-04-08 Thread Walt Weaver
On Wed, 2004-04-07 at 13:21, Bob Showalter wrote: > Weaver, Walt wrote: > > Okay, so I do a "perl -pi -e 's/$/;/g' " to try and append a > > semicolon to the end of each record in a file in Linux. > > > > It does that just fine. Unfortunately it also prepends a semicolon > > onto the beginning of

Re: An extremely newbie question about appending records in a file.

2004-04-07 Thread JupiterHost.Net
Weaver, Walt wrote: Okay, so I do a "perl -pi -e 's/$/;/g' " to try and append a Untested but off hand somethign along the lines of: perl -pi -e 's/(.)$/\1\;/g' semicolon to the end of each record in a file in Linux. It does that just fine. Unfortunately it also prepends a semicolon onto the

RE: An extremely newbie question about appending records in a fil e.

2004-04-07 Thread Bob Showalter
Weaver, Walt wrote: > Okay, so I do a "perl -pi -e 's/$/;/g' " to try and append a > semicolon to the end of each record in a file in Linux. > > It does that just fine. Unfortunately it also prepends a semicolon > onto the beginning of each record too. Well, not exactly. Note that there's no semi

An extremely newbie question about appending records in a file.

2004-04-07 Thread Weaver, Walt
Okay, so I do a "perl -pi -e 's/$/;/g' " to try and append a semicolon to the end of each record in a file in Linux. It does that just fine. Unfortunately it also prepends a semicolon onto the beginning of each record too. Now, I can vi the file and do a ":%s/$/;/g" and it works just fine. Wh

  1   2   3   4   >