Re: How do I feed terminal output into a perl script...

2003-02-09 Thread John W. Krahn
Mark Vanmiddlesworth wrote: > > I want to feed the output of an "ls" command into a perl script and > store it as a variable, but I can't seem to figure out how to do this. > How can I get this working? To store the results in a scalar: my $results = `ls`; To store the results in an array: my

Re: How do I feed terminal output into a perl script...

2003-02-09 Thread Harry Putnam
Mark VanMiddlesworth <[EMAIL PROTECTED]> writes: > I want to feed the output of an "ls" command into a perl script and > store it as a variable, but I can't seem to figure out how to do > this. How can I get this working? > > thanks, > mark > > p.s. I'm using tcsh on mac os 10.2 I now nothing abo

How do I feed terminal output into a perl script...

2003-02-09 Thread Mark VanMiddlesworth
I want to feed the output of an "ls" command into a perl script and store it as a variable, but I can't seem to figure out how to do this. How can I get this working? thanks, mark p.s. I'm using tcsh on mac os 10.2 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Help geting rid of annoying "setting locale failed" messgaes

2003-02-09 Thread Mark VanMiddlesworth
I'm using Mac OS X (10.2), and upgraded the default installation (5.6.0) to 5.8.0. Now, whenever I run the 'perl' command through tcsh I get this annoying error: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LC_ALL = (unset), LANG =

Problem with While condition in file upload

2003-02-09 Thread Mike Garner
Hello all- I'm trying to write a script that will upload a file from a web page and store that file on the web server. I've snipped out the piece of code below that's supposed to do this for me. This is running under use CGI ':standard'; use strict; and use warnings without any errors. # $file

RE: Removing duplicates from an array

2003-02-09 Thread Beau E. Cox
Hi - > -Original Message- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED]] > Sent: Sunday, February 09, 2003 3:32 PM > To: Troy May > Cc: Perl List > Subject: Re: Removing duplicates from an array > > > Troy May wrote: > > > Hello, > > > > What's the best and cleanest way to remove d

Re: Mysql lib

2003-02-09 Thread Bob Showalter
reavey wrote: > I'm interested in libraries or procedures which can produce reports > on a mysql > database. The DBI module is recommended for database access. You'll need the DBD::mysql driver module to go with it. > I've loaded a mysql database which has powerball numbers. > I'd like to analyze

Re: Removing duplicates from an array

2003-02-09 Thread R. Joseph Newton
Troy May wrote: > Hello, > > What's the best and cleanest way to remove duplicates from an array? I have > an array that reads entries from a text file and I would like to remove all > the duplicates from it. > > Thanks in advance! > > Troy I'd say prevention is the best cure. Check for duplica

cmd history with CPAN shell

2003-02-09 Thread Harry Putnam
Setup: OS Linux (Redhat 8) Perl: 5.8.0 CPAN: 1.65 $SHELL: Bash Anyone else here have trouble getting a command history to work with the perl CPAN shell (perl -MCPAN -e shell)? I have mu OS readline packages installed. rpm -qa |grep readline readline-4.3-3 readline-devel-4.3-3 As well as the

Mysql lib

2003-02-09 Thread reavey
I'm interested in libraries or procedures which can produce reports on a mysql database. I've loaded a mysql database which has powerball numbers. I'd like to analyze the data for simple things like: Which number occurs most frequently? Adding the winning numbers and taking their average? Statisti

Re: calling sub

2003-02-09 Thread Benjamin Jeeves
It still add record that it found on the first pass though the while loop to my database what I need is some way to mark my file to the point that it get to so it will not find a dupluted of the some record as the file grows. ant ideas on how I do that. On Sunday 09 Feb 2003 8:30 pm, Rob Dixon

Re: Removing duplicates from an array

2003-02-09 Thread Jenda Krynicky
From: "Troy May" <[EMAIL PROTECTED]> > What's the best and cleanest way to remove duplicates from an array? > I have an array that reads entries from a text file and I would like > to remove all the duplicates from it. Run perldoc -q duplicate :-) Jenda = [EMAIL PROTECTED] === http:/

Re: calling sub

2003-02-09 Thread R. Joseph Newton
Rob Dixon wrote: > ...(who taught you to Capitalise > your scalars :-? )... Huh?!? "Taught"?? Wuzzat mean--"taught"? ~( ;- |) ) Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Pipe Help

2003-02-09 Thread R. Joseph Newton
anthony wrote: > Hi, > > But like i said on my second post i wanted to learn how to receive message > from pipe. > > anthony Hi Anthony, That's fine. but use the pipe for it's designed purpose, which is NOT to return data to a calling program. Try constructing your own version of "more", mayb

Removing duplicates from an array

2003-02-09 Thread Troy May
Hello, What's the best and cleanest way to remove duplicates from an array? I have an array that reads entries from a text file and I would like to remove all the duplicates from it. Thanks in advance! Troy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: calling sub

2003-02-09 Thread Rob Dixon
Rob Dixon wrote: > sub alert > { > seek FILEIN, 0, SEEK_SET; > > while( ) Of course, that should be while () > { > # does some thing on pattern matching > } > } Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: calling sub

2003-02-09 Thread Rob Dixon
Benjamin Jeeves wrote: > On Sunday 09 Feb 2003 7:23 pm, Rob Dixon wrote: >> >> I'm pretty sure that, as I said before, you're reading from the file >> in several different places. The 'start' subroutiine will read the >> first >> line and then call 'build_db' which may well read all of the rest of

Re: slurp in file

2003-02-09 Thread R. Joseph Newton
ktb wrote: > >From the book - > $addressbook{"Paddy Malone"} = { > address => "23, Blue Jay Way", > phone => "404-6599" > }; > > And then bring them back into the program to print out. > Thanks, > kent Hi Kent, How about "don't do it"? Look, when your text shows an assignment

Re: CPAN module - cmd history

2003-02-09 Thread Harry Putnam
"Jenda Krynicky" <[EMAIL PROTECTED]> writes: > Tell us what OS do you have and someone will be able to give some > more details. Yeah, sorry. OS is linux (Redhat 8). I have both Term::ReadLine (which is part of 5.8.0 I think and Term::ReadLine::Gnu which isn't. I have newest CPAN-1.65 install

Re: calling sub

2003-02-09 Thread Rob Dixon
R. Joseph Newton wrote: > Rob Dixon wrote: > >>> $filein = $ARGV[0]; >>> open(filein, "$filein"); >> >> Filehandles are traditionally all uppercase, and it's not >> good to put a variable in quotes unless you have a reason >> to. >> >> open FILEIN, $filein; > > You're right, of course, about th

Re: calling sub

2003-02-09 Thread Rob Dixon
Benjamin Jeeves wrote: > if I do not call build_db then alert will run fine as I want it to so > is there away around this problem. See I need the FILEIN to go though > a number of different sub routes how would I go about this. Benjamin. I'm pretty sure that, as I said before, you're reading fro

Re: Spamassassin Ports

2003-02-09 Thread R. Joseph Newton
Tom Beer wrote: > Hi, > > I just tried to install Spamassassin out of the FreeBSD ports. > Even from cpan it didn't work out. After that, I tryed to download > a package from HTML::Parser from cpan and did a make with the same results. > Any suggestions are welcome. > > Please CC:' I'm currently n

Re: calling sub

2003-02-09 Thread R. Joseph Newton
Rob Dixon wrote: > > $filein = $ARGV[0]; > > open(filein, "$filein"); > > Filehandles are traditionally all uppercase, and it's not > good to put a variable in quotes unless you have a reason > to. > > open FILEIN, $filein; You're right, of course, about the quotes. It seems to me that this

Re: Pipe Help

2003-02-09 Thread anthony
Hi, But like i said on my second post i wanted to learn how to receive message from pipe. anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: CPAN module - cmd history

2003-02-09 Thread Jenda Krynicky
From: Harry Putnam <[EMAIL PROTECTED]> > Should I have a cmd history with the current CPAN module? > > If it is something I can setup. Can someone explain how? Yes you should, but it may depend on your OS. Under WinNT/2k/XP it's the console that provides the history, under Win9x you need to l

Re: Pipe Help

2003-02-09 Thread R. Joseph Newton
anthony wrote: > Hi, > > for the while loop i figure out before your answers, anyhow, my question was > should i send the whole array or not? > also is it possible to retrieve the data from the pipe or not? > > Anthony No and no. There are better ways than using a pipe. Pipes makes sense only w

CPAN module - cmd history

2003-02-09 Thread Harry Putnam
Should I have a cmd history with the current CPAN module? If it is something I can setup. Can someone explain how? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: slurp in file

2003-02-09 Thread Wiggins d'Anconia
ktb wrote: Is there any function that places perl code from a file into a program as if it was just part of the program file itself? perldoc -f use perldoc -f require perldoc -f eval Will get you started. As for slurping data: perldoc -f open perldoc perlopentut http://danconia.org -- To u

Re: Pipe Help

2003-02-09 Thread zentara
On Sun, 9 Feb 2003 11:02:52 +0100, [EMAIL PROTECTED] (Anthony) wrote: >Hi, > >for the while loop i figure out before your answers, anyhow, my question was >should i send the whole array or not? >also is it possible to retrieve the data from the pipe or not? If you don't want to use a module like

slurp in file

2003-02-09 Thread ktb
Is there any function that places perl code from a file into a program as if it was just part of the program file itself? Something like: file ** Hello World. ** program $file = slurp('file'); print "$file\n": I'm creating an address book as described on page 237 of "Beg

Spamassassin Ports

2003-02-09 Thread Tom Beer
Hi, I just tried to install Spamassassin out of the FreeBSD ports. Even from cpan it didn't work out. After that, I tryed to download a package from HTML::Parser from cpan and did a make with the same results. Any suggestions are welcome. Please CC:' I'm currently not subscribed! Thanks Tom pro

Re: calling sub

2003-02-09 Thread Dave K
Benjamin Jeeves, You can probably figure this out. Try running the code below supplying whatever file name you choose to save it as for an argument. #!/usr/bin/perl -w use strict; my $filein = $ARGV[0]; print "$filein\n"; open(FILEIN, $filein); my $counter = 0; my $counter1; &start; sub start

Re: calling sub

2003-02-09 Thread Benjamin Jeeves
if I do not call build_db then alert will run fine as I want it to so is there away around this problem. See I need the FILEIN to go though a number of different sub routes how would I go about this. On Sunday 09 Feb 2003 4:39 pm, Benjamin Jeeves wrote: > Can someone tell me why my call to bu

Re: calling sub

2003-02-09 Thread Rob Dixon
Benjamin Jeeves wrote: > Can someone tell me why my call to build_db() works but when I call > alert() it will not work as it calls alert but will not enter the > while loop I my opening the file with > > #!/usr/bin/perl Please add these lines here: use strict; use warnings; as together

Re: calling sub

2003-02-09 Thread ktb
On Sun, Feb 09, 2003 at 04:39:00PM +, Benjamin Jeeves wrote: > > Can someone tell me why my call to build_db() works but when I call alert() it > will not work as it calls alert but will not enter the while loop I my > opening the file with > > #!/usr/bin/perl > > $filein = $ARGV[0]; > ope

calling sub

2003-02-09 Thread Benjamin Jeeves
Can someone tell me why my call to build_db() works but when I call alert() it will not work as it calls alert but will not enter the while loop I my opening the file with #!/usr/bin/perl $filein = $ARGV[0]; open(filein, "$filein"); sub start { for(;;) { while

Re: confused with File::Glob

2003-02-09 Thread Rob Dixon
Harry Putnam wrote: > "John W. Krahn" <[EMAIL PROTECTED]> writes: >>> >>> use File::Glob ':glob'; >>^^^ >> Note that the only options available are ':case', ':nocase' and >> ':globally', > > Maybe it recognizes the abbrev or something. Doesn't seem to be > wreaking havoc a

Re: confused with File::Glob

2003-02-09 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: >> cat ./testglob.pl >> #!/usr/local/bin/perl -w >> >> use File::Glob ':glob'; >^^^ > Note that the only options available are ':case', ':nocase' and > ':globally', Maybe it recognizes the abbrev or something. Doesn't seem t

Re: Marking a file

2003-02-09 Thread John W. Krahn
Benjamin Jeeves wrote: > > Hi all Hello, > Can you help me I my tailing a growing file but in between these I execute a > script which to has the same file as the growing file is there a way to mark > were I got to in the file so when the file grow the script that is executed > in the fi

Marking a file

2003-02-09 Thread Benjamin Jeeves
Hi all Can you help me I my tailing a growing file but in between these I execute a script which to has the same file as the growing file is there a way to mark were I got to in the file so when the file grow the script that is executed in the first pass will know that start at the plac

Re: Pipe Help

2003-02-09 Thread anthony
Hi, for the while loop i figure out before your answers, anyhow, my question was should i send the whole array or not? also is it possible to retrieve the data from the pipe or not? Anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]