Re: Very slow array searching

2003-07-28 Thread George P.
On Tue, 29 Jul 2003, Rafaqat Ali Chaudhary wrote: > Dear all, > > I've a function which searches a given number from an array and returns > the result. > > Function: > > 1.sub checkNumber($) > 2.{ > 3.my ($l_number) = @_; > 4.my $l_status; > 5.my @ma

Mail Parser?

2003-07-28 Thread Pablo Fischer
Hi! Reading the thread: "Extracting string", extracting the extension and the basename I got sorprised that exists a module to do that (today I was doing that, to separate the basename and extension, but now that I have finish I know that exists a module :-(). So I would like to know if exists

Very slow array searching

2003-07-28 Thread Rafaqat Ali Chaudhary
Dear all, I've a function which searches a given number from an array and returns the result. Function: 1. sub checkNumber($) 2. { 3. my ($l_number) = @_; 4. my $l_status; 5. my @matches= grep { /$l_number/ } @numbers; 6. if (@match

Re: Thumb-nailing Pic's

2003-07-28 Thread Randal L. Schwartz
> "Ramon" == Ramon Chavez <[EMAIL PROTECTED]> writes: Ramon> I have found useful for making thumbnails of the same size, Ramon> regardless of the original size, the program "Express Thumbnail Ramon> Creator", from Express Soft (theres is a full working demo Ramon> version). It doesn't matter t

Re: Undef or Destroy?

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Pablo Fischer said: >sub load_file { >my $this = shift; >$this->{FILE_ZIP} = $_[0]; >} > >But, If its the second file I would like to delete the last FILE_ZIP, so, >whats better before loading the filename in FILE_ZIP: There's no need to remove the first FILE_ZIP. >$this->{FIL

New to list...needing help

2003-07-28 Thread Bruce Whealton, Jr.
Hi all, I've been frustrated with my initial efforts to run perl scripts on my server, or rather the server I use. I have tried a few simple form mailers, each of them failing with internal 500 error. I had a simple test.cgi perl script that I got from a recent tutorial I viewed from the lis

Just a test

2003-07-28 Thread mmbodji
Hello everyone. Just testing. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Undef or Destroy?

2003-07-28 Thread Pablo Fischer
Hi! I have a foreach that's looking for files in a directory, if foreach find a file I need to load it (with the function &load_file()), however, I have this in load_file: sub load_file { my $this = shift; $this->{FILE_ZIP} = $_[0]; } But, If its the second file I would like to delete

RE: extracting a string

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Tara Calishain said: >At 01:22 PM 7/28/2003, you wrote: > >>> What perl function can i use to extract a >>> sub-string from a string. >> >>$string = 'myfile.txt'; >> >>$string =~ m/^(\w+)\.txt$/; > >When I saw this question I immediately thought > >my $string = "myfile.txt"; >my $s

RE: Hash Dereferenced

2003-07-28 Thread Hanson, Rob
There is nothing wrong with the sample you gave, there must be some other error causing the message. And given that message it is apparently a false message. Look for a missing colon, particularly on the previous line, or an unclosed quote above that piece of code. Here is a code sample doing wh

RE: Returning variables

2003-07-28 Thread Dan Muey
Howdy all! Thanks for everyone who gave suggestions on this. I'm ending up doing hash since it seems the best way to do what I want: my %x; for(100..1,2) { $x{$_} = "... $_"; } print "$x{1978} $x{57} Howdy!"; Thanks all! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: extracting a string

2003-07-28 Thread Tara Calishain
At 01:22 PM 7/28/2003, you wrote: >> Hi there, >> >> What perl function can i use to extract a >> sub-string from a string. >> >> > >$string = 'myfile.txt'; > >$string =~ m/^(\w+)\.txt$/; > >print $1; When I saw this question I immediately thought my $string = "myfile.txt"; my $subst

Re: perl/crontab Question

2003-07-28 Thread denis
On Mon, 28 Jul 2003, John W. Krahn wrote: > [EMAIL PROTECTED] wrote: > > > > This may be a bit off topic, but I'll ask it.. > > > > I have a perl job I want to run out of a cron job, However cron is not > > reading my .cshrc file by default. > > That is the way cron works. It has a VERY limite

Hash Dereferenced

2003-07-28 Thread bseel
I am trying to take a hash reference and then duplicate it so that I can manipulate that data without affecting the original data. I used "my %href = %$hashRef;" (without the quotes) to do that. $hashRef is a hash reference that is passed into the subroutine. However, when I try to run it, I get

Re: perl/crontab Question

2003-07-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > This may be a bit off topic, but I'll ask it.. > > I have a perl job I want to run out of a cron job, However cron is not > reading my .cshrc file by default. That is the way cron works. It has a VERY limited environment. > So what I have to do is "wrap" the perl >

RE: Returning variables

2003-07-28 Thread david
Dan Muey wrote: >> You've got it, only, don't return anything. >> >> Here is a command-line example: >> >>perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"' >> >> This is basically exactly what you have there. It's not >> supposed to "return" variables, but rather "create" var

Re: Returning variables

2003-07-28 Thread Steve Grazzini
On Mon, Jul 28, 2003 at 03:23:10PM -0500, Dan Muey wrote: > That what I'd say also except here I'm using a series of > numbers for(100..1000) { } Each one has the same string > except the number is different And then want to just declare > them all with one call and use them as I want. Nope.

RE: Returning variables

2003-07-28 Thread Bob Showalter
Dan Muey wrote: > Howdy list! > > I was wondering if it's possible to run a funtion and have it set a > bunch of variables. > > As in variables I didn't declare before. Yes, but don't do it. > > #/usr/bin/perl -w > > use strict; > > makevars(); # declares, and gives a value to $one $two $

Re: Returning variables

2003-07-28 Thread Casey West
It was Monday, July 28, 2003 when Dan Muey took the soap box, saying: : > You've got it, only, don't return anything. : > : > Here is a command-line example: : > : >perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"' : > : > This is basically exactly what you have there. It's no

perl/crontab Question

2003-07-28 Thread denis
This may be a bit off topic, but I'll ask it.. I have a perl job I want to run out of a cron job, However cron is not reading my .cshrc file by default. So what I have to do is "wrap" the perl job in a tcsh shell and then run the shell file out of cron. Is there a better way? Or maybe the real

RE: Returning variables

2003-07-28 Thread Dan Muey
> You've got it, only, don't return anything. > > Here is a command-line example: > >perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"' > > This is basically exactly what you have there. It's not > supposed to "return" variables, but rather "create" variables. > > Just a note

Returning variables

2003-07-28 Thread Dan Muey
Howdy list! I was wondering if it's possible to run a funtion and have it set a bunch of variables. As in variables I didn't declare before. #/usr/bin/perl -w use strict; makevars(); # declares, and gives a value to $one $two $three print "$one $two $three"; I could have it return a ref

RE: Mail::Sender question

2003-07-28 Thread Dan Muey
Ok I'll simplify the question: If I do this: use Mail::Sender; my $sender = new Mail::Sender {smtp => $ip, from => $frm}; $sender->Open({ to => $to, subject => $sb, priority => 5, cc => $cc, bcc => $bcc, confirm => $cfm, }); $sender->SendLineEnc($m

Re: :Pop3 mdoule

2003-07-28 Thread awarsd
Hi, Thanx , i went there but i didn't understand how make it work, are you sure i can use it? Regards awarsd "Stephen Gilbert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Check out Mime::Parser on CPAN -Original Message- From: awarsd [mailto:[EMAIL PROTECTED] Sent: Monda

RE: Error Variable in Package

2003-07-28 Thread Dan Muey
> No. You should't export it. "Exporting" means making an > "alias" to the variable in the package that issues the "use". > > If you refer to the variable as $Package::Error, you don't > need to export it. If you export it, you would refer to it as > simply $Error. But that might interfere with

Re: Destroy Object?

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Pablo Fischer said: >Ok, I Save the field (Cofnig_Dirtmp, config_dirproceso, config_dirrecep), Now >I dont see any reason to continue with $dbf, can I delete it? I just need it >to retrieve data. > >I know that I could do > >$dbf->close(); > >and in DemoDB.pm I could have: > >sub close

Destroy Object?

2003-07-28 Thread Pablo Fischer
Hi! I have a class that the only function its to retrieve data from the database (mysql), I choose field that I need calling it in this form: my $dbf = new DemoDB(), my $dZip = {}; #Esta es la variable con la que se ira trabajando a lo largo d' la clase $dZip->{CONFIG_DIRTM

RE: Error Variable in Package

2003-07-28 Thread Bob Showalter
Dan Muey wrote: > Thanks for the reply! > > > Sorry I don't understand your question well, but from > > overall, I guess that's all about what you want... > > I'll try to make it simpler, I have a tendency to ramble! > > I've seen packages that have a variable like $Package::Error or > $Package:

Re: Error Variable in Package

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Dan Muey said: >What I'm trying to figure out is the best way to have a function return 0 >on failure and set the Error Variable for me to use. > package MyGoodies; > ... > my $MyGoodies::Error; # declare the variable in the package and Export it and > function().

RE: Error Variable in Package

2003-07-28 Thread Dan Muey
Thanks for the reply! > Sorry I don't understand your question well, but from > overall, I guess that's all about what you want... I'll try to make it simpler, I have a tendency to ramble! I've seen packages that have a variable like $Package::Error or $Package::errstr I want a funtion in tha

RE: :Pop3 mdoule

2003-07-28 Thread Stephen Gilbert
Check out Mime::Parser on CPAN -Original Message- From: awarsd [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 1:54 PM To: [EMAIL PROTECTED] Subject: Re: :Pop3 mdoule Hi, I got how to retrieve message, the problem is now If i send an Attachment i don't know how to retrieve it, and

Re: Net::Pop3 mdoule

2003-07-28 Thread awarsd
Hi, I got how to retrieve message, the problem is now If i send an Attachment i don't know how to retrieve it, and if in the text area I put a webpage i don't know how to retrieve it, Any guidance is more than welcome -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Mail::Sender question

2003-07-28 Thread Dan Muey
I use Mail::Sender all the time to send mail (Thanks Jenda!) For a simple plain text message I do new( with smtp and from) then Open (with to and subject) Since that is the minimal setup for me. What I'd like to do is add headers if they are specifed, after Open() and SendLineEnc(). Is that pos

Re: Error Variable in Package

2003-07-28 Thread LI NGOK LAM
Sorry I don't understand your question well, but from overall, I guess that's all about what you want... ### # Main.pl use MyGoodies; my $fedback = $MyGoodies::Error(); ### # MyGoodies.pm package MyGoodies; use strict; sub Error {check

RE: extracting a string

2003-07-28 Thread Joe Echavarria
Thanks. --- Dan Muey <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > What perl function can i use to extract a > > sub-string from a string. > > > > > > $string = 'myfile.txt'; > > $string =~ m/^(\w+)\.txt$/; > > print $1; > > HTH > > DMuey > > > I have "myfile.txt", and i

RE: extracting a string

2003-07-28 Thread Dan Muey
> Hi there, > > What perl function can i use to extract a > sub-string from a string. > > $string = 'myfile.txt'; $string =~ m/^(\w+)\.txt$/; print $1; HTH DMuey > I have "myfile.txt", and i only want to print > "myfile" to the screen , how can i do it ? > > >Thanks.

Re: extracting a string

2003-07-28 Thread Casey West
It was Monday, July 28, 2003 when Joe Echavarria took the soap box, saying: : : : Hi there, : : What perl function can i use to extract a sub-string from a : string. : : : I have "myfile.txt", and i only want to print "myfile" to the : screen , how can i do it ? If you woul

I hope I'm viewing this correwctIRE: Error Variable in Package

2003-07-28 Thread Dan Muey
> Howdy List! > > Quick question about Packages and an Error Variable. > > I have a little package I made and can do; > > use MyGoodies; > > and can export the $MyGoodies::Error from it as well as a function. > > What I'm trying to figure out is the best way to have a > function return 0 o

extracting a string

2003-07-28 Thread Joe Echavarria
Hi there, What perl function can i use to extract a sub-string from a string. I have "myfile.txt", and i only want to print "myfile" to the screen , how can i do it ? Thanks. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web si

Error Variable in Package

2003-07-28 Thread Dan Muey
Howdy List! Quick question about Packages and an Error Variable. I have a little package I made and can do; use MyGoodies; and can export the $MyGoodies::Error from it as well as a function. What I'm trying to figure out is the best way to have a function return 0 on failure and set the Err

Net::Pop3 mdoule

2003-07-28 Thread awarsd
Hi, I want to retrieve email from my website using a program. like hotmail it is just the administrator side of my program (if someone is out of town and no access to his/her computer). I can retrieve subject and to fine using Regex but I can't seem to get the Text message. maybe i should use anot

Re: xor - i just don't understand *sigh*

2003-07-28 Thread John W. Krahn
William M West wrote: > > #!/usr/bin/perl -w > use strict; > use diagnostics; > > my $a = 1; > my $b = 2; > my $c = 2; > my $d; > > print "xor1" if ($a = $a) ^ ($b = $c);#prints > > print "xor2" if ($a = $b) ^ ($b = $c);#no print > > print "xor3" if ($a = $b) xor ($b = $c);#no print > > print

Re: base-filename without modules

2003-07-28 Thread Steve Grazzini
On Sun, Jul 27, 2003 at 10:40:29PM -0700, Bryan Harris wrote: >>> Is there a generally accepted way to get the "base" of a >>> filename [...] without using any modules? >> >> Sure, that's fine -- but why don't you want to use modules? >> >> File::Basename has been in the core distribution for a

Re: Need to change details in a Microsoft Access Database file

2003-07-28 Thread Edgar Pigg
DerekB, You need to take a look at Win32::ODBC if you are on a MS system. Set up your access database as an ODBC source. On Monday, July 28, 2003, at 09:44 AM, Derek Byrne wrote: I've edited it in the past using Access, but want to create a perl script which will allow me to change the val

Re: Problem with pass by reference

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Pandey Rajeev-A19514 said: >In this subroutine, @FORMATTED_OUTPUT was filled up as a 2 dimensional >array $FORMATTED_OUTPUT[$i][$j]. >sub ABC { >.. SOME CODE >return (\$rows, \$cols, [EMAIL PROTECTED]); >} WHY are you returning a reference to a scalar? If $rows is a reference to

Need to change details in a Microsoft Access Database file

2003-07-28 Thread Derek Byrne
Hi, I have a database file with multiple entries which is an output from a now extinct SQL database. I've edited it in the past using Access, but want to create a perl script which will allow me to change the values for this one file (which I can then send out to our remote computers). Curren

RE: xor - i just don't understand *sigh*

2003-07-28 Thread Dan Muey
> #!/usr/bin/perl -w > > use strict; > use diagnostics; > > > my $a = 1; > my $b = 2; > my $c = 2; > my $d; > > print "xor1" if ($a = $a) ^ ($b = $c);#prints > > print "xor2" if ($a = $b) ^ ($b = $c);#no print > > print "xor3" if ($a = $b) xor ($b = $c);#no print > > print "xor4" if ($a = $a

module install

2003-07-28 Thread Sylvain Masnada
Hi all, I have to install the openCA::X509 module for openCA. I need some modules that I installed successfully thanks to perl -MCPAN -eshell. But I get error when installing OpenCA::X509 module (I installed OpenCA::OpenSSL successfully). Can anybody help me please. Thanks Sylvain [EMAIL PROTEC

Re: xor - i just don't understand *sigh*

2003-07-28 Thread Gary Stainburn
On Monday 28 July 2003 2:55 pm, West, William M wrote: > #!/usr/bin/perl -w > > use strict; > use diagnostics; > > > my $a = 1; > my $b = 2; > my $c = 2; > my $d; > > print "xor1" if ($a = $a) ^ ($b = $c);#prints Presumably this is because you're using the assignment operator and not the comparis

xor - i just don't understand *sigh*

2003-07-28 Thread West, William M
#!/usr/bin/perl -w use strict; use diagnostics; my $a = 1; my $b = 2; my $c = 2; my $d; print "xor1" if ($a = $a) ^ ($b = $c);#prints print "xor2" if ($a = $b) ^ ($b = $c);#no print print "xor3" if ($a = $b) xor ($b = $c);#no print print "xor4" if ($a = $a) xor ($b = $c);#no prints print "x

RE: Telnet.pm and Unix prompt

2003-07-28 Thread Vidal, Christopher, SOLCM
Thanks. Your explanation is very clear. The modules User Doc section is not sore clear ... very cumbersome. Thanks again. Regards, Christopher Vidal -Original Message- From: Jeff Westman [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 4:35 PM To: beginners Subject: Re: Telnet.

Re: Regarding fontface infromation

2003-07-28 Thread Rob Dixon
Visu wrote: > hi, > How can i get the fontface name in a html file? For example in the below tag > , i want to get Arial in my output.Any pointers are > welcome. The following program will check all the tags in a file and print the value of the 'face' attribute if it has one. The HTML file is s

Re: Thumb-nailing Pic's

2003-07-28 Thread Ramon Chavez
You are all right and I agree with you. I was answering the original message, wich asks how to show all the images the same size regardless of the original size. I really prefeer to use true thumbnails, because of the size (in bytes). Talking about "dumbnails". Agreeing with 'zentara', the disa

Re: How to add modul directory to @INC

2003-07-28 Thread Rob Dixon
Sudarshan Raghavan wrote: > [EMAIL PROTECTED] wrote: > > > It is my first time writing a module. After executing a script that > > requires my module, I got an error "blabla not found in /usr/lib/perl > > etc.". > > So I moved my module to /usr/lib/perl/ and it work o.k. > > Recently I read somewhe

Re: How to add modul directory to @INC

2003-07-28 Thread Sudarshan Raghavan
[EMAIL PROTECTED] wrote: It is my first time writing a module. After executing a script that requires my module, I got an error "blabla not found in /usr/lib/perl etc.". So I moved my module to /usr/lib/perl/ and it work o.k. Recently I read somewhere that, instead of always moving my modules to

Re: Problem with pass by reference

2003-07-28 Thread Sudarshan Raghavan
Pandey Rajeev-A19514 wrote: Hi, The dimension of the data increases by each pass by reference. In this subroutine, @FORMATTED_OUTPUT was filled up as a 2 dimensional array $FORMATTED_OUTPUT[$i][$j]. sub ABC { .. SOME CODE return (\$rows, \$cols, [EMAIL PROTECTED]); } In subroutine DEF, ABC

RE: catching STDERR

2003-07-28 Thread Marcos . Rebelo
well I found the answer to my question: use strict; use IPC::Open3; local(*stdin, *stdout, *stderr); open3(\*stdin, \*stdout, \*stderr, "perl testeSTDERR.pl"); print(join(", ", )); close *stdin; close *stdout; close *stderr; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL P

How to add modul directory to @INC

2003-07-28 Thread mygrps
It is my first time writing a module. After executing a script that requires my module, I got an error "blabla not found in /usr/lib/perl etc.". So I moved my module to /usr/lib/perl/ and it work o.k. Recently I read somewhere that, instead of always moving my modules to /usr/lib/perl/, I could p

Problem with pass by reference

2003-07-28 Thread Pandey Rajeev-A19514
Hi, The dimension of the data increases by each pass by reference. In this subroutine, @FORMATTED_OUTPUT was filled up as a 2 dimensional array $FORMATTED_OUTPUT[$i][$j]. sub ABC { .. SOME CODE return (\$rows, \$cols, [EMAIL PROTECTED]); } In subroutine DEF, ABC is called, and the dimension

Re: Notetab-like Perl editor?

2003-07-28 Thread Alan C.
Zanardi2k3 wrote: Questions about editors have been asked many times, but i'm going to be a little more specific. I am in a Windows environment, and i love NotaTab. It is one of the few tools that makes me wonder how could i ever have carried on without it. Only it doesn't do syntax highlightin

catching STDERR

2003-07-28 Thread Marcos . Rebelo
For testing I have this script :: testeSTDERR.pl : warn "$_\n" foreach (1..10); ::: :: showSTDERR.pl :: use strict; open FILE, "perl testeSTDERR.pl |2 "; print(join(", ", )); close FILE

Thumbnail pics - reply

2003-07-28 Thread Support
Thanks to all who responded about setting pic sizes on a perl generated html page. It just needed a few nudges to remove the memory block. A great forum everyone, keep it up Regards Colin --- www.rentmypla

RE: Regarding fontface infromation

2003-07-28 Thread Visu
On Mon, 28 Jul 2003, Charles K. Clarkson wrote: > Visu <[EMAIL PROTECTED]> asked: > : How can i get the fontface name in a html file? > > The tag can be anywhere in the page. It > does not necessarily apply to the entire page. Also, > CSS allows changing the font face without using > tags

RE: Regarding fontface infromation

2003-07-28 Thread Charles K. Clarkson
Visu <[EMAIL PROTECTED]> asked: : How can i get the fontface name in a html file? The tag can be anywhere in the page. It does not necessarily apply to the entire page. Also, CSS allows changing the font face without using tags. Can you supply more details about what you are doing? : For e

Re: Notetab-like Perl editor?

2003-07-28 Thread Bob X
"Zanardi2k3" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Questions about editors have been asked many times, but i'm going to be a > little more specific. > > I am in a Windows environment, and i love NotaTab. It is one of the few > tools that makes me wonder how could i ever hav

Regarding fontface infromation

2003-07-28 Thread Visu
hi, How can i get the fontface name in a html file? For example in the below tag , i want to get Arial in my output.Any pointers are welcome. Thanks, sv -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]