Re: Anti spam/away script

2003-02-07 Thread R. Joseph Newton
"G.D. Bell" wrote: > # Variables > $alt_nick = "set_alt_nick"; > ... > # Away Functions > IRC::add_command_handler("gbell72", set_alt_nick); > IRC::add_command_handler("gbell72|afk", set_alt_nick); So what is going on here? I see a bareword being offered to a function. This seems to me that it

Re: Reading Plain Text File - help

2003-02-07 Thread R. Joseph Newton
Ramón Chávez wrote: > Thank you very much guys. > > Rob, sorry but it didn't work > > open (DATOS, "$bd") || die "Error: no se puede abrir el > archivo"; > > while ($registro=) {} Hi Ramon, The empty brackets in the line above were meant to represent the whole body of the

Re: web server 500 error

2003-02-07 Thread R. Joseph Newton
Samuel Mauntz wrote: > Thanks George, I thought that was something I had in earlier that I had > accidentally deleted...I took your advice though and stuck that html header > in there after the shebang... Now try printing the content header BEFORE the shebang. Consider--when you are accessing

Re: perl's pattern-matching within VB

2003-02-07 Thread R. Joseph Newton
Ben Crane wrote: > Hi all, > > Is there a way of using perl's amazing > pattern-matching skills within VB???I find using VB to > query txt files, etc to be more cumbersome and less > friendly than perl's. I'm not sure about regexes, but I know that VB has the split function. It looks from MSDN

Re: trailing white space

2003-02-07 Thread R. Joseph Newton
"Fromm, Marc" wrote: > Hi > > I created a script that reads a file and attaches a string infront of each read in >item. When the file is saved with the changes though, each item has a blank line >between the next item. The original text document does is single sapced. > > Original tesxt file >

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Dave K
Peter, #!/usr/bin/perl -w use strict; my %date_formats = ( ccyymmdd => { now => sub { my @arr = localtime(); print 'Year ', 1900 + $arr[5] . ' Month '. sprintf("%02d",$arr[4] + 1) . ' Day ' . sprintf("%02d",$arr[3]); } } ); & { $date_formats{ccyymmdd}{now} }; Same output as previous

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Dave K
Peter I saw Jenda's note and I suggest the code needs simplification. > P.S. you can see where I comment out the ccyymmdd_now function. That > approach works, but is not what I'm shooting for. > > %date_formats = ( > # "ccyymmdd" => {now => \ccyymmdd_now()}, > "ccyymmdd" => {now => s

Re: How to Handle Large files in Perl ?

2003-02-07 Thread Rob Dixon
Madhu Reddy wrote: > Hi, > We are doing file operations on large files(more > than 5GB). > basically reading the file and validatiing the each > record in in the file. > > we used Tie::File > It took 35 min to read and count the number of lines > in file of 8millions (500MB) > > following

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Rob Dixon
Peter Farrar wrote: > Hi All, > > I swear I've called subroutines this way before, but I can't find any > examples. > In this case, I'm looking to build some time/date functions. > Regardless of what the actual code is supposed to do, the calling of > subroutines as elements of a hash is causing me

How to Handle Large files in Perl ?

2003-02-07 Thread Madhu Reddy
Hi, We are doing file operations on large files(more than 5GB). basically reading the file and validatiing the each record in in the file. we used Tie::File It took 35 min to read and count the number of lines in file of 8millions (500MB) following is the script Does anybody have a

RE: variable from command line

2003-02-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Thomas Browner wrote: > Is there away for perl enter an variable from the command line. > > For example: > > ./test.pl tom > > > > > > Thomas Browner You have a number of options, but @ARGV holds what comes from the command line. $ARGV[0] holds item 1, $ARGV[1] holds item 2, etc.

RE: Missing " ; " ?

2003-02-07 Thread Jeff Westman
Bob- This was extremely useful. Thanks for the tips. Regards, Jeff --- Bob Showalter <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > I inherited this script, whose code is as follows: > > > > #!/usr/local/bin/perl -w > > ... > > # 'while' starts on line 42 > > while (($app_key, $ap

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread Jenda Krynicky
From: "John W. Krahn" <[EMAIL PROTECTED]> > Peter Farrar wrote: > > I swear I've called subroutines this way before, but I can't find > > any examples. In this case, I'm looking to build some time/date > > functions. Regardless of what the actual code is supposed to do, > > the calling of subrouti

Re: variable from command line

2003-02-07 Thread Jose Malacara
Yes, with $ARGV[0]. The number is the variable postion. 0 is the first. #!/usr/bin/perl $name = $ARGV[0]; print "Hello, $name!\n"; -Jose - Original Message - From: "Thomas Browner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 07, 2003 2:04 PM Subject: variable fro

RE: variable from command line

2003-02-07 Thread wiggins
On Fri, 7 Feb 2003 15:04:16 -0600, "Thomas Browner" <[EMAIL PROTECTED]> wrote: > Is there away for perl enter an variable from the command line. > > For example: > > ./test.pl tom > perldoc perlvar (I think) Input on the command line is aut

variable from command line

2003-02-07 Thread Thomas Browner
Is there away for perl enter an variable from the command line. For example: ./test.pl tom Thomas Browner

RE: Missing " ; " ?

2003-02-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Jeff Westman wrote: > I inherited this script, whose code is as follows: > > #!/usr/local/bin/perl -w > ... > # 'while' starts on line 42 > while (($app_key, $app_value) = each %app_file_count) { > delete ($app_file_count{$app_key});e > } > > What is the "hanging 'e' on line 43?

Re: calling a subroutine as an element of a hash table...

2003-02-07 Thread John W. Krahn
Peter Farrar wrote: > > Hi All, > > I swear I've called subroutines this way before, but I can't find any > examples. > In this case, I'm looking to build some time/date functions. Regardless of > what the actual code is supposed to do, the calling of subroutines as > elements of a hash is causi

Re: Missing " ; " ?

2003-02-07 Thread John W. Krahn
Jeff Westman wrote: > > I inherited this script, whose code is as follows: > > #!/usr/local/bin/perl -w > ... > # 'while' starts on line 42 > while (($app_key, $app_value) = each %app_file_count) { > delete ($app_file_count{$app_key});e > } > > What is the "hanging 'e' on line

RE: Missing " ; " ?

2003-02-07 Thread Bob Showalter
Jeff Westman wrote: > I inherited this script, whose code is as follows: > > #!/usr/local/bin/perl -w > ... > # 'while' starts on line 42 > while (($app_key, $app_value) = each %app_file_count) { > delete ($app_file_count{$app_key});e > } > > What is the "hanging 'e' on line 43?

calling a subroutine as an element of a hash table...

2003-02-07 Thread Peter_Farrar
Hi All, I swear I've called subroutines this way before, but I can't find any examples. In this case, I'm looking to build some time/date functions. Regardless of what the actual code is supposed to do, the calling of subroutines as elements of a hash is causing me grief. I am receiving the foll

RE: Missing " ; " ?

2003-02-07 Thread Dan Muey
> > I inherited this script, whose code is as follows: > > #!/usr/local/bin/perl -w > ... > # 'while' starts on line 42 > while (($app_key, $app_value) = each %app_file_count) { > delete ($app_file_count{$app_key});e It's the letter 'e' after the ; in the line above. > } >

Missing " ; " ?

2003-02-07 Thread Jeff Westman
I inherited this script, whose code is as follows: #!/usr/local/bin/perl -w ... # 'while' starts on line 42 while (($app_key, $app_value) = each %app_file_count) { delete ($app_file_count{$app_key});e } What is the "hanging 'e' on line 43? It is not a subroutine call, and ther

RE: Anti spam/away script

2003-02-07 Thread Dan Muey
Just out of curiousity, I assume your script sends a message back to the sender asking for verification / an away message. How do you incorporate IRC into it? What is it's overall function? Just curious because I've been wanting to do something similar but the IRC thing sounded interesting. D

RE: Net::FTP to "put" local code instead of file

2003-02-07 Thread Dan Muey
> > Dan Muey wrote: > > Hello all, > > Has any body done this/know how to dit/know if it's even possible?? > > > > > > __SHORT VERSION__ > > How do I / Is it possible to -- use Net::FTP to send a file to a > > remote server that isn't an actual file but rather a > variable with the > > file's

RE: Anti spam/away script

2003-02-07 Thread wiggins
On Fri, 7 Feb 2003 13:53:03 -0500 (EST), "G.D. Bell" <[EMAIL PROTECTED]> wrote: > Hi all > > I've started composing this script but seem to be a > little stuck at the moment ..when I run script as it > is presntly these errors occur..Name "main::a

Re: changing passwords on nt

2003-02-07 Thread Felix Geerinckx
on vr, 07 feb 2003 16:50:08 GMT, Thomas Browner wrote: > Is there a way to use perl to change nt password. If so could some tell > me how to do it. See http://www.roth.net/perl/adminmisc/#SetPassword -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Anti spam/away script

2003-02-07 Thread Rob Dixon
G.D. Bell wrote: > Hi all > > I've started composing this script but seem to be a > little stuck at the moment ..when I run script as it > is presntly these errors occur..Name "main::alt_nick" > used only once: possible typo at maria.pl line 26. > Name "main::awaytime" used only once: possible typo

RE: Reading Plain Text File - help

2003-02-07 Thread Kipp, James
> > I'm trying to read the last line on a Plain text File. > > The following was so well written by John I think it's worth > repeating. Thanks John! Absolutely. This should be made into a FAQ !! (or is there one already?) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

Re: Reading Plain Text File - help

2003-02-07 Thread Rob Dixon
Rgíón «hávkú wrote: > I'm trying to read the last line on a Plain text File. The following was so well written by John I think it's worth repeating. Thanks John! John W. Krahn wrote: > > 1) Install http://search.cpan.org/author/URI/File-ReadBackwards-0.98/ > > use File::ReadBackwards; > my $bw =

Re: Net::FTP to "put" local code instead of file

2003-02-07 Thread Rob Dixon
Dan Muey wrote: > Hello all, > Has any body done this/know how to dit/know if it's even possible?? > > > __SHORT VERSION__ > How do I / Is it possible to -- use Net::FTP to send a file to a > remote server that isn't an actual file but rather a variable with > the file's contents? > > EG :: > $ftp-

Anti spam/away script

2003-02-07 Thread G.D. Bell
Hi all I've started composing this script but seem to be a little stuck at the moment ..when I run script as it is presntly these errors occur..Name "main::alt_nick" used only once: possible typo at maria.pl line 26. Name "main::awaytime" used only once: possible typo at maria.pl line 28. Name "ma

RE: Net::FTP to "put" local code instead of file

2003-02-07 Thread wiggins
On Fri, 7 Feb 2003 12:39:14 -0600, "Dan Muey" <[EMAIL PROTECTED]> wrote: > > > Any ideas/different modules/etc.. > > > > > > > Though my understanding may not be complete, and it would > > take two scripts and may not be portable off of *nix s

RE: Net::FTP to "put" local code instead of file

2003-02-07 Thread Dan Muey
> > On Fri, 7 Feb 2003 10:32:12 -0600, "Dan Muey" > <[EMAIL PROTECTED]> wrote: > > > Hello all, > > Has any body done this/know how to dit/know if it's even possible?? > > > > > > __SHORT VERSION__ > > How do I / Is it possible to -- use Net:

RE: Reading Plain Text File - help

2003-02-07 Thread Ramón Chávez
Thank you very much guys. Rob, sorry but it didn't work open (DATOS, "$bd") || die "Error: no se puede abrir el archivo"; while ($registro=) {} ($file, $vot_tot, $ult_vot, $sum_vot) = split(/:/,$registro); $lineas = $.; close (DATOS);

RE: Net::FTP to "put" local code instead of file

2003-02-07 Thread wiggins
On Fri, 7 Feb 2003 10:32:12 -0600, "Dan Muey" <[EMAIL PROTECTED]> wrote: > Hello all, > Has any body done this/know how to dit/know if it's even possible?? > > > __SHORT VERSION__ > How do I / Is it possible to -- use Net::FTP to send a file to

RE: Reading Plain Text File - help

2003-02-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ramón Chávez wrote: > I'm trying to read the last line on a Plain text File. > > But when I use: > > open (DATOS, "$bd") || die "Error: no se puede abrir el archivo"; > while > ATOS>){ > $registro = ; > } > > I don't get any value on $registro > > I need to insert $ini

RE: Reading Plain Text File - help

2003-02-07 Thread Hanson, Rob
The "while()" is pulling a line, as well as the "$registro = ". while () { # reads a line into $_ $registro = ; # reads a SECOND line } My guess is that the while() is reading the last line of the file, leaving nothing for $registro. Use this instead (although there is probably a more efficie

RE: Reading Plain Text File - help

2003-02-07 Thread Ramón Chávez
Sorry. Last message had an error. -- I'm trying to read the last line on a Plain text File. But when I use: open (DATOS, "$bd") || die "Error: no se puede abrir el archivo"; while ATOS>){ $registro = ; } I don't get any value on $registro I ne

changing passwords on nt

2003-02-07 Thread Thomas Browner
Is there a way to use perl to change nt password. If so could some tell me how to do it. Thomas

Reading Plain Text File - help

2003-02-07 Thread Ramón Chávez
I'm trying to read the last line on a Plain text File. But when I use: open (DATOS, "$bd") || die "Error: no se puede abrir el archivo"; while ATOS>){ $registro = ; } I don't get any value on $registro I need to insert $inicio = ; -- This way to get the the las

Net::FTP to "put" local code instead of file

2003-02-07 Thread Dan Muey
Hello all, Has any body done this/know how to dit/know if it's even possible?? __SHORT VERSION__ How do I / Is it possible to -- use Net::FTP to send a file to a remote server that isn't an actual file but rather a variable with the file's contents? EG :: $ftp->("$html_code","newfile.html")

RE: Using 'IF EXISTS'

2003-02-07 Thread Dan Muey
> The English of what I want to do is "If this remote value is > not defined, then skip over it and proceed on to the next > entry in the list." > > > > I want to avoid an error is the key doesn't exist. Every > variation of IF EXISTS I use doesn't work correctly. Is there > something obvio

RE: web server 500 error

2003-02-07 Thread Dan Muey
> > > Thanks George, I thought that was something I had in earlier > that I had accidentally deleted...I took your advice though > and stuck that html header in there after the shebang and > just before I printed out any html. Unfortunately your > suggestion didn't fix the problem. The h

Re: perl's pattern-matching within VB

2003-02-07 Thread Jenda Krynicky
From: Ben Crane <[EMAIL PROTECTED]> > Is there a way of using perl's amazing > pattern-matching skills within VB???I find using VB to > query txt files, etc to be more cumbersome and less > friendly than perl's...I was wondering whether anyone > had been able to utilize perl from within VB, and if

RE: perl's pattern-matching within VB

2003-02-07 Thread NYIMI Jose (BMB)
Searching from google gives one the following : http://sources.redhat.com/ml/cygwin/2000-07/msg00975.html The seach : http://www.google.be/search?q=Perl+in+VB&ie=UTF-8&oe=UTF-8&hl=nl&meta= HTH, José. > -Original Message- > From: Ben Crane [mailto:[EMAIL PROTECTED]] > Sent: Friday, Febr

perl's pattern-matching within VB

2003-02-07 Thread Ben Crane
Hi all, Is there a way of using perl's amazing pattern-matching skills within VB???I find using VB to query txt files, etc to be more cumbersome and less friendly than perl's...I was wondering whether anyone had been able to utilize perl from within VB, and if so, how? I'm presuming using a perl

Re: system() in perl5.4 (dos version)

2003-02-07 Thread Rob Dixon
N. Ganesh Babu wrote: > Hi, > > When I execute a dos command with system() in perl5.4 (djgpp dos > version) it is not working. Can any one please help in executing the > dos commands in perl. Hi Ganesh. You should be able to say simply: my $result = system ("command"); but without knowing w

Re: a though question of using variable in pattern

2003-02-07 Thread Rob Dixon
R. Joseph Newton wrote: > Rob Dixon wrote: >> >> print my $t="href=\"(.*?)\">"; >> outputs >> href="(.*?)"> > > H. this gets me thinking. How does that translate into a regex > when such a variable is passed in? Would Perl do the escaping and > feed the regex something like: > > /hre

Re: modify the first few lines of a file

2003-02-07 Thread Rob Dixon
Sashidhar wrote: > I may have to change the length of the files. Is there no way, like > manipulating the inode entries to reflect any changes in the length. > Ofcourse, I realize that this is specific to the linux/unix env. > The problem is a limitation of the filing system itself. The starting p

RE: remote execution

2003-02-07 Thread NYIMI Jose (BMB)
Net::Telnet module is probably the starting place ... http://search.cpan.org/author/JROGERS/Net-Telnet-3.03/lib/Net/Telnet.pm#SYNOPSIS HTH, José. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 07, 2003 10:05 AM > To: [EMAIL PROTECTED]

system() in perl5.4 (dos version)

2003-02-07 Thread N. Ganesh Babu
Hi, When I execute a dos command with system() in perl5.4 (djgpp dos version) it is not working. Can any one please help in executing the dos commands in perl. Regards, Ganesh -- N. Ganesh Babu Asst. Production Manager Apex Logical Dataconversion Pvt. Ltd. 303 & 304 M.G.R. Estate Dwarakapuri C

remote execution

2003-02-07 Thread km
Hi all, i need to execute a C executable on a remote system from mine and get the results(like output files etc) back on to my system. how do i do this with perl ? which module do i need to use? enlighten me -- KM -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: Using 'IF EXISTS'

2003-02-07 Thread Janek Schleicher
On Fri, 07 Feb 2003 00:13:47 -0800, Paul Harwood wrote: > The English of what I want to do is "If this remote value is not > defined, then skip over it and proceed on to the next entry in the > list." The canonical ways to do it are either foreach my $item (@list) { next unless defined $item

Re: trailing white space

2003-02-07 Thread Gary Stainburn
On Friday 07 Feb 2003 5:04 am, Fromm, Marc wrote: > Hi > > I created a script that reads a file and attaches a string infront of each > read in item. When the file is saved with the changes though, each item > has a blank line between the next item. The original text document does is > single sap

Re: web server 500 error

2003-02-07 Thread Samuel Mauntz
Thanks George, I thought that was something I had in earlier that I had accidentally deleted...I took your advice though and stuck that html header in there after the shebang and just before I printed out any html. Unfortunately your suggestion didn't fix the problem. The hosting company I'm work

Using 'IF EXISTS'

2003-02-07 Thread Paul Harwood
The English of what I want to do is "If this remote value is not defined, then skip over it and proceed on to the next entry in the list." I want to avoid an error is the key doesn't exist. Every variation of IF EXISTS I use doesn't work correctly. Is there something obvious I am missing?

trailing white space

2003-02-07 Thread Fromm, Marc
Hi I created a script that reads a file and attaches a string infront of each read in item. When the file is saved with the changes though, each item has a blank line between the next item. The original text document does is single sapced. Original tesxt file item1 item2 item3 Saved text fil

Using 'IF EXISTS'

2003-02-07 Thread Paul Harwood
The English of what I want to do is "If this remote value is not defined, then skip over it and proceed on to the next entry in the list." I want to avoid an error is the key doesn't exist. Every variation of IF EXISTS I use doesn't work correctly. Is there something obvious I am missing?