Re: Parsing multiline data

2004-10-20 Thread Bee
use strict; open F, "sourcefile.txt"; local $/ = "\n\n"; my @sections = ; close F; print "Section $_ :\n $sections[$_]\n\n" for @sections; HTH, Bee - Original Message - From: "Kevin Old" [EMAIL PROTECTED] To: <[EMAIL PROTECTED]> Sent: Thursday, October 21, 2004 10:27 AM Subject: Parsi

RE: .txt To Mysql.......roy

2004-10-20 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: .txt To Mysql.......roy

2004-10-20 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

Need to have the data flow diagram for Bug tracking

2004-10-20 Thread Anish Kumar K.
Hi Sorry to mail in the PERL group. As the Open Source Bug tracking software was done using PERL-CGI I thought this will be helpful. Can anyone help me in getting the DFD for Bug Tracking System. Thanks Anish

Re: Broken Subroutine

2004-10-20 Thread John W. Krahn
Ron Smith wrote: Here's the problem: My input looks like the following: C:\Perl\scripts\shots\sp2\shot_1\dir.txt C:\Perl\scripts\shots\sp2\shot_1\drames.txt C:\Perl\scripts\shots\sp2\shot_1\filename.0001.cin [snip] C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0008.rgb C:\Perl\scripts\sho

Re: Broken Subroutine

2004-10-20 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Ron Smith wrote: my @basenames = &basenames(@paths); sub basenames { foreach (@_) { if ($_ =~ /(\w+)\.\d+\.\w+$/) { @basenames = $1; # print "@basenames\n"; That line assigns to @basenames the extracted basename from the last path only,

Re: Parsing multiline data

2004-10-20 Thread David le Blanc
On Wed, 20 Oct 2004 22:27:20 -0400, Kevin Old <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I have several "sections" of data that look like this: > > Title: DESIGN JOURNAL (COVER) > Purpose: Product Spotlight > Penetration: National > Role: Media Relations, Content Support > Results: Elevated

Parsing multiline data

2004-10-20 Thread Kevin Old
Hello everyone, I have several "sections" of data that look like this: Title: DESIGN JOURNAL (COVER) Purpose: Product Spotlight Penetration: National Role: Media Relations, Content Support Results: Elevated Publicity and Brand Awareness Credits: Evolutif Senior Management Team Award: 2001 Award f

Re: Broken Subroutine

2004-10-20 Thread Dan Jones
On Wed, 2004-10-20 at 23:19, Ron Smith wrote: > The following is the code: > #!/usr/bin/perl -w > use strict; > my @paths = `dir /b/s`; # print > @paths; > my @basenames = &basenames(@paths); > sub basenames { > foreach (@_) { > if ($_ =~ /(\w+)\.\d+\.\w+$/) { >

Re: Broken Subroutine

2004-10-20 Thread Gunnar Hjalmarsson
Ron Smith wrote: #!/usr/bin/perl -w use strict; my @paths = `dir /b/s`; # print @paths; my @basenames = &basenames(@paths); sub basenames { foreach (@_) { if ($_ =~ /(\w+)\.\d+\.\w+$/) { @basenames = $1; # print "@basenames\n"; That line assigns

Broken Subroutine

2004-10-20 Thread Ron Smith
Here's the problem: My input looks like the following: C:\Perl\scripts\shots\sp2\shot_1\dir.txt C:\Perl\scripts\shots\sp2\shot_1\drames.txt C:\Perl\scripts\shots\sp2\shot_1\filename.0001.cin C:\Perl\scripts\shots\sp2\shot_1\filename.0002.cin C:\Perl\scripts\shots\sp2\shot_1\filename.0003.

RE: Why wont this read my file?

2004-10-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dave Kettmann wrote: > Hi list, I'm trying to read a file and I cant see why it wont.. Here > is a spot of code I used for debugging. It should print out the file > (right?): > > *snip* > open MSTROCN, ">>/tmp/ocndir/master-ocn.txt"; This opening file in append mode. Either remove the >>

Why wont this read my file?

2004-10-20 Thread Dave Kettmann
Hi list, I'm trying to read a file and I cant see why it wont.. Here is a spot of code I used for debugging. It should print out the file (right?): *snip* open MSTROCN, ">>/tmp/ocndir/master-ocn.txt"; while ( ) { print "$_"; } *snip* Eventually I want any existence of "NPA-NXX\tOcn " to be

Re: Multiple Perl installations

2004-10-20 Thread mgoland
Just in case anyone bumps into this problem, only solution I can find is temperatily changing /usr/opt/perl5 to point to old installation of perl. [ in my case /usr/opt/perl5.old]. Ofcourse this required root access, I am wondering if anyone knows other solutions. - Original Message - F

Re: SPAM:spawning multiple processes

2004-10-20 Thread Wiggins d Anconia
> > HI. First time poster... :) > For some reason your message was marked as SPAM, and not by me, as I don't have spam filters enabled > I am trying to write a script that spawns a number of children processes. > The number of children processes is determined at run time based on a > confi

RE: simple regular expression problem

2004-10-20 Thread Steve Bertrand
> Steve Bertrand wrote: > ... >> while ($buf = ) { >> # $buf now contains line of file, one per each loop of while >> $buf =~ /(\w+)/; >> $userName = $1; >> ...do something with $userName >> } > > This is a common error. You should not use $1 without making sure the > regex > did in

RE: simple regular expression problem

2004-10-20 Thread Bob Showalter
Steve Bertrand wrote: ... > while ($buf = ) { > # $buf now contains line of file, one per each loop of while > $buf =~ /(\w+)/; > $userName = $1; > ...do something with $userName > } This is a common error. You should not use $1 without making sure the regex did in fact match. Othe

RE: scrolling_list and multiples

2004-10-20 Thread Charlotte Hee
On Sat, 16 Oct 2004, Charles K. Clarkson wrote: > Date: Sat, 16 Oct 2004 07:51:36 -0500 > From: Charles K. Clarkson <[EMAIL PROTECTED]> > To: 'Charlotte Hee' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Subject: RE: scrolling_list and multiples > > Charlotte Hee <[EMAIL PROTECTED]> wrote: > > : Here

RE: simple regular expression problem

2004-10-20 Thread Steve Bertrand
> So \w means the first non word character. Oh, and BTW, \W would be the non-word match pattern, not \w. Steve What about the ~ / before > the > (\w? And what does the + sign do? Is $buf a command? > > Thanks > > AD > > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED] >

RE: simple regular expression problem

2004-10-20 Thread Steve Bertrand
> So \w means the first non word character. What about the ~ / before > the > (\w? And what does the + sign do? Is $buf a command? Although I do not claim to be an expert, nor do I play one on TV, I'll give a try at this one. Here's the command that was given to you: ($acct) = $buf =~ /(\w+)/; $

RE: simple regular expression problem

2004-10-20 Thread adisegna
So \w means the first non word character. What about the ~ / before the (\w? And what does the + sign do? Is $buf a command? Thanks AD -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 8:57 AM To: 'Khairul Azmi'; [EMAIL PROTECTED] Subject:

SPAM:spawning multiple processes

2004-10-20 Thread brian . barto
HI. First time poster... :) I am trying to write a script that spawns a number of children processes. The number of children processes is determined at run time based on a configuration file. I am having trouble finding a way to create these children processes. They have to be independant of the

RE: grep, and push to array if item not found

2004-10-20 Thread Steve Bertrand
> Steve Bertrand wrote: >> > Steve Bertrand wrote: >> > > I got it... >> > > >> > > for my $item (@clean) { >> > > if (! grep ($_ eq $item, @array)) { >> > > push (@array, $item); >> > > print "$item\n"; >> > > } >> > > } >> > >> > FWIW, this is a FAQ

Re: qx operator

2004-10-20 Thread Randal L. Schwartz
> "Jason" == Jason Wozniak <[EMAIL PROTECTED]> writes: Jason> Can anyone tell me why Jason> @file_list = qx/find $search_dir -name test1.txt/; Jason> returns a file list consisting of every file below the value of Jason> $search_dir? Jason> Back tics do the same thing. Jason> I'm trying

RE: grep, and push to array if item not found

2004-10-20 Thread Bob Showalter
Steve Bertrand wrote: > > Steve Bertrand wrote: > > > I got it... > > > > > > for my $item (@clean) { > > > if (! grep ($_ eq $item, @array)) { > > > push (@array, $item); > > > print "$item\n"; > > > } > > > } > > > > FWIW, this is a FAQ (see "perl

qx operator

2004-10-20 Thread Jason Wozniak
Can anyone tell me why @file_list = qx/find $search_dir -name test1.txt/; returns a file list consisting of every file below the value of $search_dir? Back tics do the same thing. I'm trying to search input file directories for shell scripts with hard coded passwords and replace them with n

Re: Multiple Perl installations

2004-10-20 Thread mgoland
- Original Message - From: "Jenda Krynicky" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, October 19, 2004 4:50 PM Subject: Re: Multiple Perl installations > From: [EMAIL PROTECTED] > > I currently have 2 Perl installations 5.6.0 and 5.8.3 installed on one

RE: grep, and push to array if item not found

2004-10-20 Thread Steve Bertrand
> Steve Bertrand wrote: >> I got it... >> >> for my $item (@clean) { >> if (! grep ($_ eq $item, @array)) { >> push (@array, $item); >> print "$item\n"; >> } >> } > > FWIW, this is a FAQ (see "perldoc -q duplicate"). If the array > elements can > be c

RE: grep, and push to array if item not found

2004-10-20 Thread Bob Showalter
Steve Bertrand wrote: > I got it... > > for my $item (@clean) { > if (! grep ($_ eq $item, @array)) { > push (@array, $item); > print "$item\n"; > } > } FWIW, this is a FAQ (see "perldoc -q duplicate"). If the array elements can be compared with str

Re: grep, and push to array if item not found

2004-10-20 Thread Steve Bertrand
> Hi all, > > I am practicing using grep, but have a problem. Instead of directly > building an array in a traditional format with grep: > > @array = (grep $_, @input); > > I want to push items into a new array that DO NOT appear within the > current array being grepped for. Hence: > > use strict;

grep, and push to array if item not found

2004-10-20 Thread Steve Bertrand
Hi all, I am practicing using grep, but have a problem. Instead of directly building an array in a traditional format with grep: @array = (grep $_, @input); I want to push items into a new array that DO NOT appear within the current array being grepped for. Hence: use strict; my @array = (); m

Re: Need help to calculate average value in hash

2004-10-20 Thread Gabor Urban
On Wed, 2004-10-20 at 01:57, Pete Tong wrote: > Hi All, > > > > I have file: > > Hi, show us some code fragments that seem not to work. Post well defined question. Gabaux -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: executing 1 liners from cmd prompt

2004-10-20 Thread Bakken, Luke
> >You can't use "'" as delimiter on Windows. Try: > > > > perl -e "print \"test\n\"" > Or always use q() and qq() for one liners: perl -e"print qq(test\n)" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: executing 1 liners from cmd prompt

2004-10-20 Thread John Pretti
-Original Message- From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:18 AM To: [EMAIL PROTECTED] Subject: Re: executing 1 liners from cmd prompt Ged Murphy wrote: > How do you execute 1 liners from the windows command prompt similar to > perl -e 'p

Re: executing 1 liners from cmd prompt

2004-10-20 Thread Gunnar Hjalmarsson
John Pretti wrote: Aren't you missing a ";". I am assuming that perl in both environments would be the same; therefore, your command would look as follows: C:\perl>perl -e 'print "test\n";' instead of C:\perl>perl -e 'print "test\n"' The ";" is not necessary, since ";" is for separating statements

RE: executing 1 liners from cmd prompt

2004-10-20 Thread Murphy, Ged (Bolton)
>You can't use "'" as delimiter on Windows. Try: > > perl -e "print \"test\n\"" ahh, I didn't realise. Thanks Gunnar. The information contained in this message or any of its attachments is confidential and is intended f

RE: executing 1 liners from cmd prompt

2004-10-20 Thread John Pretti
-Original Message- From: Murphy, Ged (Bolton) [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:15 AM To: '[EMAIL PROTECTED]' Subject: executing 1 liners from cmd prompt Hi all, How do you execute 1 liners from the windows command prompt similar to perl -e 'print "test\n"

Re: executing 1 liners from cmd prompt

2004-10-20 Thread Gunnar Hjalmarsson
Ged Murphy wrote: How do you execute 1 liners from the windows command prompt similar to perl -e 'print "test\n";' that we run in unix like systems? Every time I try something along these lines I get the following error C:\perl>perl -e 'print "test\n"' Can't find string terminator "'" anywhere

executing 1 liners from cmd prompt

2004-10-20 Thread Murphy, Ged (Bolton)
Hi all, How do you execute 1 liners from the windows command prompt similar to perl -e 'print "test\n";' that we run in unix like systems? Every time I try something along these lines I get the following error C:\perl>perl -e 'print "test\n"' Can't find string terminator "'" anywhere before E

RE: LWP

2004-10-20 Thread Bob Showalter
E.Horn wrote: > i want to install LWP! > in the CPAN shell is a mistake... > I have a wrong URL ! > Can someone tell me which url i have to paste? >From within the CPAN shell, you can type o conf init To reconfigure. This will give you a menu of mirrors to choose from (you should select two o

LWP

2004-10-20 Thread E.Horn
i want to install LWP! in the CPAN shell is a mistake... I have a wrong URL ! Can someone tell me which url i have to paste? cpan> install LWP::UserAgent Please check, if the URLs I found in your configuration file (www.cpan.de) are valid. The urllist can be edited. E.g. with ``o conf urllist pu

Re: Need help to calculate average value in hash

2004-10-20 Thread David le Blanc
On Wed, 20 Oct 2004 02:08:12 +0200, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Pete Tong wrote: > > I have file: > > > > PHI: 15 > > CA: 32 > > NY: 14 > > PHI: 35 > > NY: 11 > > CA: 22 > > NY: 23 > > CA: 36 > > > > I need to put it into hash. Key â State, Value â Number (Average Value!!!) > >

Re: substitute on \Z

2004-10-20 Thread Bryan Harris
Wow. Just when you thought you knew everything about regular expressions, you find out a bunch of stuff you never knew! Thanks Jeff. I hope you're getting credit somewhere for all the help you give on this list, you deserve it. - Bryan > On Oct 19, Bryan Harris said: > >> Does anyone happe

Re: Multiple Perl installations

2004-10-20 Thread Rick Evans
> I currently have 2 Perl installations 5.6.0 and 5.8.3 installed on one of my machines. When ever I installed new modules it alway's installs them under my latest Perl installation [ 5.8.3 ], but now I have a need to compile a module against my old Perl, is there any documentation that describes