Re: problem with foreach and while with array

2002-08-28 Thread Priss
Thank you Connie for helping me on this, it was fixed by below comment you made :))) >> SOA: while () >> { >> chomp; > >You don't need to chomp it, or you don't need $/ at >last of the next line. Priss __ Do You Yahoo!? Everything you'll

Re: convert decimal to hexidecimal

2002-08-28 Thread Paul Tremblay
On Wed, Aug 28, 2002 at 09:51:11PM -0700, Randal L. Schwartz wrote: > Why?   ♠ is prefectly valid, unless you're talking about > something besides XML or HTML. > > -- Yes, it certainly is! I realized this as soon as I sent off the email. Most of RTF (I am writing a script to convert RTF to XML

Re: convert decimal to hexidecimal

2002-08-28 Thread Randal L. Schwartz
> "Paul" == Paul Tremblay <[EMAIL PROTECTED]> writes: Paul> Is there a way to convert a decimal number to a hexidecimal number in Paul> perl? Paul> I have expressions like this: Paul> \u8195\'20 Paul> \u9824\'3f Paul> The number after the u is a decimal number that needs to be converted P

Re: convert decimal to hexidecimal

2002-08-28 Thread chris
my $var = "\\u8195\\'20"; if ($var =~ /^\\u(.*)\\/){ print '&#x' . sprintf("%x", $1 . ';'); } On Wed, 28 Aug 2002 20:44:32 -0400, [EMAIL PROTECTED] (Paul Tremblay) wrote: >Is there a way to convert a decimal number to a hexidecimal number in >perl? > >I have expressions like this: > >\u8195\

Re: Pods

2002-08-28 Thread Wiggins d'Anconia
On a side note, the CPAN already does this if it is a module that can be located there. For instance: http://search.cpan.org/author/FGLOCK/Date-Tie-0.14/lib/Date/Tie.pm And then you could just "Save as" in most browsers. You might have to strip out some of the links, or you might actually

Re: convert decimal to hexidecimal

2002-08-28 Thread Steve Grazzini
Paul Tremblay <[EMAIL PROTECTED]> wrote: > Is there a way to convert a decimal number to a hexidecimal > number in perl? $ perldoc -f sprintf > I have expressions like this: > > \u8195\'20 > \u9824\'3f > > The number after the u is a decimal number that needs to be > converted to hexidecai

Re: Date Timestamp question

2002-08-28 Thread Wiggins d'Anconia
Felix Geerinckx wrote: > on Wed, 28 Aug 2002 16:02:00 GMT, Sean Rowe wrote: > > >>I have a date/timestamp value that I need to check against another >>date/timestamp value for >, >=, <=, <, or =. Is there already a >>function that will do this, or do I need to write one? Thanks. > > > This

Re: upload.cgi

2002-08-28 Thread Wiggins d'Anconia
This was sent to the wrong user. Note: remember to *group reply* to messages so that the list e-mail is kept in the headers. Vargas media you should see what Andres wrote below and it appears that someone else had replied to your original post (8/27), which I just came across, with some codi

Re: Net::RawIP module

2002-08-28 Thread drieux
On Wednesday, August 28, 2002, at 03:49 , Bridget Benson wrote: > I am having trouble using the Net::RawIP::dump function. > > I keep getting the error Bad filehandle for line 4 in this code. > What is wrong with $fh? > > $p = open_offline($filename); > $fh = dump_open($p, "file"); > $packet = n

Re: upload.cgi

2002-08-28 Thread Wiggins d'Anconia
Note: questions of this nature you might want to send to [EMAIL PROTECTED] as that is a list specifically about cgi, though in most cases the beginners list will be able to help you too. Vargas Media wrote: > Hi, > I have been studying with the O'Reilly book "CGI Programming with Perl" - > Cha

Re: convert decimal to hexidecimal

2002-08-28 Thread John W. Krahn
Paul Tremblay wrote: > > Is there a way to convert a decimal number to a hexidecimal number in > perl? > > I have expressions like this: > > \u8195\'20 > \u9824\'3f > > The number after the u is a decimal number that needs to be converted > to hexidecail. The number after the second slash need

upload.cgi

2002-08-28 Thread Vargas Media
Hi, I have been studying with the O'Reilly book "CGI Programming with Perl" - Chapter 5 page 99 Below is an example of a upload.cgi that utilizes CGI.pm I am not able to get it to work correctly yet and I am trying to find out if it is the directory I am trying to load the file to or a progammatic

convert decimal to hexidecimal

2002-08-28 Thread Paul Tremblay
Is there a way to convert a decimal number to a hexidecimal number in perl? I have expressions like this: \u8195\'20 \u9824\'3f The number after the u is a decimal number that needs to be converted to hexidecail. The number after the second slash needs to simply be elimianted. Thus, the two li

Net::RawIP module

2002-08-28 Thread Bridget Benson
I am having trouble using the Net::RawIP::dump function. I keep getting the error Bad filehandle for line 4 in this code. What is wrong with $fh? $p = open_offline($filename); $fh = dump_open($p, "file"); $packet = next($p, \%hdr); dump($fh, \%hdr, $packet); I understand this may not be a begi

Re: globbing problem with longfilenames containing spaces (Windows)

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 20:34:31 GMT, Peter Farrar wrote: > Here is the code I'm having problems with: > > my @arr = glob("$here\\*"); > foreach $val (@arr){ > if (-d $val){ > travel_dirs($val, $level-1) if $level > 0; > }else{print"$val\n";} >

Re: Checking for .jpg/.gif/.png files

2002-08-28 Thread david
[EMAIL PROTECTED] wrote: > Hello, All: > > I need to check files to make sure that they are .gif, .jpg, or .png > graphic files before processing them. How can I verify that? > > e.g., In unix, the 'type' command returns the file's type. > all .gif, .jpg and .png file have a special header

globbing problem with longfilenames containing spaces (Windows)

2002-08-28 Thread Peter_Farrar
Hi all, Here is the code I'm having problems with: my @arr = glob("$here\\*"); foreach $val (@arr){ if (-d $val){ travel_dirs($val, $level-1) if $level > 0; }else{print"$val\n";} } 'else print $val' is just there for debugging, so I c

RE: PERL ON XP USING IIS SERVER

2002-08-28 Thread Beau E. Cox
HERB - You have to do several things: > Go into the IIS Manager in Admin Tools > if you want to set up perl for all your www sites, bring up the properties of your server (top node) and Edit WWW Service. > to setup just one site, pring up properties from that web site. > now you have a pro

Error when I try to use perldoc

2002-08-28 Thread Brad Fike
I get the following error when I try to get documentation about a module or function. Can't spawn "cmd.exe": No such file or directory at C:\Perl\bin/perldoc.bat line 395. does anyone have a fix for this? -Thanks, Brad ** Not

Re: problem with foreach and while with array

2002-08-28 Thread Connie Chan
> > Wonder if someone could help me, I am trying to write > a script to pulls out all the machine names from a > revese DNS file, some how, my script will only print > out the machine names with 1.x.x.in-addr.arpa > > $nslookup = '/usr/local/bin/nslookup'; > $dig = '/usr/local/bin/dig'; >

RE: Executing perl in Linux

2002-08-28 Thread Beau E. Cox
Thanks Felix - You're right, it's a leftover from my Win32 wimp days. All is well... Aloha => Beau. -Original Message- From: Felix Geerinckx [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 8:55 AM To: [EMAIL PROTECTED] Subject: Re: Executing perl in Linux on Wed, 28 Aug 2002

Re: Executing perl in Linux

2002-08-28 Thread drieux
On Wednesday, August 28, 2002, at 11:36 , Beau E. Cox wrote: [..] > For perl script 'x' > > ls -l x > -rwxr-xr-x1 root root 41 Aug 28 08:13 x > cat x > #!/usr/bin/perl > print "Hello world\n"; > ../x > bash: ./x: bad interpreter: No such file or directory

RE: PERL ON XP USING IIS SERVER

2002-08-28 Thread Beau E. Cox
Hi - I have perl 5.6.1 running fine on XP. I use the free ActiveState perl located at: http://www.activestate.com/Products/ActivePerl/ Just go ther, hit the download, and install. If you want to use IIS perl scripting, be sure to check that box during install (default is on if IIS is ac

Re: multiple concurrent processes

2002-08-28 Thread david
Philip Montgomery wrote: > I am trying to figure out how to run process concurrently from Perl. I > want the parent to spawn off the children and wait until they are complete > to continue. I can get the child processes to run in serial, but I need > them to run in parallel. > > The code I am

RE: Newbie Question - Monitoring NT Server(s) andNotification...

2002-08-28 Thread Kipp, James
have you looked at the modules: Win32::Perflib Win32::Lanman Win32::AdminMisc Those 3 should give you most of what you need. Read the docs for them and google for examples. the examples in the docs are pretty good. also see the following links for help and examples: http://patriot.net/~carvdawg/p

RE: Interpolation problem

2002-08-28 Thread Beau E. Cox
Thanks Japhy and Wags - I figured it was simple. Aloha => Beau. -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 8:18 AM To: Beau E. Cox Cc: [EMAIL PROTECTED] Subject: Re: Interpolation problem On Aug 28, Beau E. Cox said: >I can'

Re: Executing perl in Linux

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 18:36:43 GMT, Beau E. Cox wrote: > For perl script 'test' It's not a good idea to name your script 'test', but that's another story > For perl script 'x' > bash: ./x: bad interpreter: No such file or directory This script probably has DOS-style line-endings () instead

Re: Redirect STDOUT and SDTERR

2002-08-28 Thread david
you probably want to save STDERR before redirect it to STDOUT so that later you can change it back: open(OLD_ERR,">&STDERR"); open(STDOUT,">$log_full_name"); open(STDERR,">&STDOUT"); #-- code #-- restore STDERR open(STDERR,">&OLD_ERR"); other than that. your code seems to be ok. david Nyimi

PERL ON XP USING IIS SERVER

2002-08-28 Thread HB
Has anyone figured out how to run perl on XP yet? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Executing perl in Linux

2002-08-28 Thread Beau E. Cox
Hi all - I recently installed SuSE 8.0 Linux on several of my boxes (Microsoft has finally become unaffordable to me) and I am having a ball! I have one problem: sometimes the #!/usr/bin/perl works, sometimes not. For perl script 'test' ls -l test -rwxr-xr-x1 root root

Re: Pods

2002-08-28 Thread Paul Johnson
On Wed, Aug 28, 2002 at 06:02:10PM +, Michael D. Risser wrote: > OK I guess what I should be asking is, how do you determine where > perldoc is looking for pods, I found some of them in $LIB/perl5, but not > all of them are there. perldoc -l Module > And after checking the tarballs for the

problem with foreach and while with array

2002-08-28 Thread Priss
Hiya, Wonder if someone could help me, I am trying to write a script to pulls out all the machine names from a revese DNS file, some how, my script will only print out the machine names with 1.x.x.in-addr.arpa $nslookup = '/usr/local/bin/nslookup'; $dig = '/usr/local/bin/dig'; @ZONES = qw

RE: Using a file as body of message.....

2002-08-28 Thread Kipp, James
> message, how could I do this in perl? > > /usr/sbin/sendmail [EMAIL PROTECTED] < ./file.txt > > I am trying to avoid slurpping the file into an array. my > @array = `/bin/cat > ../file.txt` how about something like this: my $sendmail = '/usr/lib/sendmail'; my $userName = '[EMAIL PROTECTED]

Re: Interpolation problem

2002-08-28 Thread Jeff 'japhy' Pinyan
On Aug 28, Beau E. Cox said: >I can't figure this one out. I have a requirement >to grab from some sort of input the elements of a regular >expression and execute it. All is fine except when I use >$1, $2, ... in the substitution, as: This is in the FAQ, and one of the MOST commonly asked FAQs I

RE: Interpolation problem

2002-08-28 Thread David . Wagner
You are using single quotes which tell Perl to NOT interpret what is between the single quotes. SO '$2 $1' becomes $2 $1 in the new variable while "$2 $1" would become the values of $2 and $1. Wags ;) -Original Message- From: Beau E. Cox [mailto:[EMAIL PROTECTED]] Sent: Wednesda

Interpolation problem

2002-08-28 Thread Beau E. Cox
Hi all - I can't figure this one out. I have a requirement to grab from some sort of input the elements of a regular expression and execute it. All is fine except when I use $1, $2, ... in the substitution, as: #!/usr/bin/perl use strict; use warnings; $_ = 'beau cox'; my $match = '(\w+)\s+(\w+

Re: Pods

2002-08-28 Thread Michael D. Risser
OK I guess what I should be asking is, how do you determine where perldoc is looking for pods, I found some of them in $LIB/perl5, but not all of them are there. And after checking the tarballs for the modules I see that the pods are not necessarily already built, and some systems may not keep t

Re: Exported Vars

2002-08-28 Thread david
Connie Chan wrote: > Thanks everybody, I've learn quite a lot in this lesson again. > Anyway, I still not up the OO level in Perl, so, quite sort of > information here I still need sometime to digest. > > Here is something I've simply test, but not confirm they are > right or not. > > When I pi

RE: Using a file as body of message.....

2002-08-28 Thread James Kelty
Really sorry about this post. Should have looked aroung google a bit. No need to reply. I figured it out. Thanks! -James -Original Message- From: James Kelty [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 9:44 AM To: [EMAIL PROTECTED] Subject: Using a file as body of message

Re: Pods

2002-08-28 Thread Jeff 'japhy' Pinyan
On Aug 28, Michael D. Risser said: >Does anyone know where, or how to determine where, pods for installed >modules are? *Most* modules have the pod contained in their source code. Others have it stored as Module.pod or This/Module.pod, if it's excessively large. -- Jeff "japhy" Pinyan [E

Pods

2002-08-28 Thread Michael D. Risser
Does anyone know where, or how to determine where, pods for installed modules are? I have several modules whose pods I would like to convert to html, but I don't know where they live, such as Date::Tie. -- Michael D. Risser Software Engineer/Linux Administrator = Ma

Re: Constant Question

2002-08-28 Thread Jeff 'japhy' Pinyan
On Aug 27, Timothy said: >I am building an array of Tk button and each button will invoke the >same subroutine. However I need the index of the calling button to >be sent to the subroutine. So far I have a for loop and a SWITCH that >that works but it seems to me to be pretty poor coding: > > fo

Re: Date Timestamp question

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 16:02:00 GMT, Sean Rowe wrote: > I have a date/timestamp value that I need to check against another > date/timestamp value for >, >=, <=, <, or =. Is there already a > function that will do this, or do I need to write one? Thanks. This depends entirely on the format of the

Using a file as body of message.....

2002-08-28 Thread James Kelty
Hello, Rather then calling sendmail with a redirect to use a file as the body of a message, how could I do this in perl? /usr/sbin/sendmail [EMAIL PROTECTED] < ./file.txt I am trying to avoid slurpping the file into an array. my @array = `/bin/cat ../file.txt` Also, is it possible to tell send

Re: Crypt:Cracklib Question...sort of.

2002-08-28 Thread John Pitchko
I think use lib "/blahblah/blahblah/" should fix that. Just put in the appropriate directory path. John Pitchko Data Services Saskatchewan Government Insurance >>> "Batchelor, Scott" <[EMAIL PROTECTED]> 08/28/02 10:34am >>> I have installed the Crypt::Cracklib Module on my Redhat Linux 7.2 box

Crypt:Cracklib Question...sort of.

2002-08-28 Thread Batchelor, Scott
I have installed the Crypt::Cracklib Module on my Redhat Linux 7.2 box And I am calling it from my perl script as such: use Crypt::Cracklib; $dict = /usr/share/dict/words my $reason = fascist_check($mpass, $dict); $syn_error = "ok" if check($mpass, $dict); $syn_er

Date Timestamp question

2002-08-28 Thread Sean Rowe
I have a date/timestamp value that I need to check against another date/timestamp value for >, >=, <=, <, or =. Is there already a function that will do this, or do I need to write one? Thanks. Sean -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: make an executable File / compile perl

2002-08-28 Thread drieux
On Tuesday, August 27, 2002, at 11:43 , Angerstein wrote: [..] > How can I compile a perlscript with all modules it use in 1 fine perl > "bineary" program? [..] is your question: how to get to a single executable binary image of my perl "script", that will contain in it all

Newbie Question - Monitoring NT Server(s) and Notification...

2002-08-28 Thread Yuen, Alex
Hi All, I am also a newbie and looking to get a good start on how to actually write a Perl script to do what I need. I am looking to setup a script to monitor a NT Server(s) for: CPU usage notify if heavily used Memory usagenotify if heavily used HardDrive space

Re: multiple concurrent processes

2002-08-28 Thread zentara
On Wed, 28 Aug 2002 07:30:15 -0500, [EMAIL PROTECTED] (Philip Montgomery) wrote: >I am trying to figure out how to run process concurrently from Perl. I want the >parent to spawn off the children and wait until they are complete to continue. I can >get the child processes to run in serial, bu

Re: using Super in packages

2002-08-28 Thread drieux
On Tuesday, August 27, 2002, at 12:46 , david wrote: [..] > > thanks for the follow up and verify a ton of stuff. this is really nice. > i don't totally understand your point a). can you provide your modules A. > pm, > B1.pm and C.pm? maybe that will clarify things a bit. > > david well they hav

Re: Upload.cgi - etc

2002-08-28 Thread zentara
On Tue, 27 Aug 2002 13:35:23 -0700, [EMAIL PROTECTED] (Vargas Media) wrote: >Below is an example of a upload.cgi that utilizes CGI.pm >Any help extremely appreciated. >Steve I've commented your script with the changes I made to make it run. A full copy-n-paste is below. I had to add an O_RDWR fl

RE: scalar context?

2002-08-28 Thread Kipp, James
> > You pretty much answered your own question :-). The first is the > > an array context and you are telling it to match a chunk of the > > expression on the right and place it in the var. > > There is no such thing as array context. Did you mean list context? Oh yes. Excuse me. -- To un

RE: scalar context?

2002-08-28 Thread Kipp, James
> You pretty much answered your own question :-). The first is > the an array context and you are telling it to match a chunk > of the expression on the right and place it in the var. > > the second one in a scalar context, ask the question "does > the expr on th right match", answer is yes

RE: scalar context?

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 13:41:28 GMT, [EMAIL PROTECTED] (James Kipp) wrote: > You pretty much answered your own question :-). The first is the > an array context and you are telling it to match a chunk of the > expression on the right and place it in the var. There is no such thing as array contex

RE: scalar context?

2002-08-28 Thread Kipp, James
> > The only difference is the lack of parentheses around my > $word on the 4th line. I read that this has something to do > with scalar context, but I don't see why one would be scalar > context and not the other. They both look like scalars to me. You pretty much answered your own quest

Re: Constant Question

2002-08-28 Thread Exile
Is that another for loop be helpful ? - Original Message - From: "Timothy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 28, 2002 11:35 AM Subject: Constant Question > I am building an array of Tk button and each button will invoke the > same subroutine. However I

RE: How to unshift to an array in an array of arrays?

2002-08-28 Thread Bob Showalter
> -Original Message- > From: Angerstein [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 28, 2002 8:59 AM > To: Bob Showalter > Subject: AW: How to unshift to an array in an array of arrays? > > > hmm i have a different behavior there > > if i do: > > unshift (@{myarray[1]}, $time)

RE: Redirect STDOUT and SDTERR

2002-08-28 Thread Kipp, James
what is wrong with this way? is it not working? anway, i prefer to use CGI::Carp qw(carpout) it make redirection very simple and efficient. here is an example: # redirect standard error use CGI::Carp qw(carpout); open (ERRLOG ">/tmp/error.log") or die "..."; carpout(\*ERRLOG); > -Original M

Re: Exported Vars

2002-08-28 Thread Connie Chan
Thanks everybody, I've learn quite a lot in this lesson again. Anyway, I still not up the OO level in Perl, so, quite sort of information here I still need sometime to digest. Here is something I've simply test, but not confirm they are right or not. When I pick up an exported vars from a pac

RE: How to unshift to an array in an array of arrays?

2002-08-28 Thread Bob Showalter
> -Original Message- > From: Angerstein [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 28, 2002 6:12 AM > To: [EMAIL PROTECTED] > Subject: How to unshift to an array in an array of arrays? > > > How to unshift to an array in an array of arrays? $ perl -d -e 1 DB<1> @aoa = (

RE: generating arrays on the fly

2002-08-28 Thread Bob Showalter
> -Original Message- > From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 28, 2002 1:27 AM > To: [EMAIL PROTECTED] > Cc: Ramprasad A Padmanabhan; [EMAIL PROTECTED] > Subject: Re: generating arrays on the fly > > > Thanx > I am not a great master of perl

multiple concurrent processes

2002-08-28 Thread Philip Montgomery
I am trying to figure out how to run process concurrently from Perl. I want the parent to spawn off the children and wait until they are complete to continue. I can get the child processes to run in serial, but I need them to run in parallel. The code I am using thus far is for ($x;$x<4;$x++

Re: matching file extension .vbp and .dsp

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 11:41:59 GMT, [EMAIL PROTECTED] (Javeed Sar) wrote: > I am reading dirextory using ls. > How to match for .dsp and .vbp file extensions Why are you asking the same questions over and over again? If there is something you don't understand from previous replies, please cons

Re: sorting log

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 23:36:37 GMT, [EMAIL PROTECTED] (Sudarshan Raghavan) wrote: > On Wed, 28 Aug 2002, bobby wrote: > >> I have a log file which is generated by backup script and i am >> writing a perl script to sort the log so as to prepare it to put >> into mysql database and iam having a pr

Re: sorting log

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, bobby wrote: > Hi all > > I have a log file which is generated by backup script and i am writing a > perl script to sort the log so as to prepare it to put into mysql > database and iam having a problem in doing that. > > my log file is like this (I have written line n

Re: sorting log

2002-08-28 Thread Felix Geerinckx
on Tue, 27 Aug 2002 22:55:54 GMT, [EMAIL PROTECTED] (Bobby) wrote: > I have a log file which is generated by backup script and i am > writing a perl script to sort the log so as to prepare it to put > into mysql database and iam having a problem in doing that. Something like this? #! perl

Re: scalar context?

2002-08-28 Thread John W. Krahn
"Eddie C." wrote: > > Hello, Hello, > I have 2 little programs here and they do different things, but I don't understand >why. > > # First program > > use warnings; > use strict; > my $line = "TRAVSTAT 08-27-2002 02:20:15 There is no output file required."; > (my $word) = ($line =~ /(\S+)/);

Re: scalar context?

2002-08-28 Thread Felix Geerinckx
on Tue, 27 Aug 2002 21:17:34 GMT, [EMAIL PROTECTED] (Eddie C.) wrote: > # First program > [...] > (my $word) = ($line =~ /(\S+)/); The parentheses force the rhs to be evaluated in list context. In list context, the /(\S+)/ construct returns al list of the match(es). > # Second program > [...]

Re: Customer Name Parsing

2002-08-28 Thread John W. Krahn
Felix Geerinckx wrote: > > on Wed, 28 Aug 2002 10:11:16 GMT, [EMAIL PROTECTED] (Harry > Jackson) wrote: > > > What I would like to know is if there are any modules > > that can find similar matches in this data (soundex in Oracle is > > not quite up to the task). > > Have you already checked ou

Re: matching file extension .vbp and .dsp

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, Javeed SAR wrote: > Hi, > > I am reading dirextory using ls. > How to match for .dsp and .vbp file extensions > > Is this right? > > if ($file1 =~ m/\.vbp$/) Why run an external command, chomp and do a pattern match. Why not <*.{dsp,vbp}> -- To unsubscribe, e-mail: [

Re: AW: How to unshift to an array in an array of arrays?

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, Angerstein wrote: > Than its possible: > my $x = 0; > > my @arr1 = (1, 2, 3); > > my @arr2 = (4, 5, 6); > > my @arr3 = (7, 8, 9); > > my @arrofarrs; > > unshift (@arrofarrs, \@arr3); > > unshift (@arrofarrs, \@arr2); > > unshift (@arrofarrs, \@arr1); > unshift (@arr1, $x);

Re: matching file extension .vbp and .dsp

2002-08-28 Thread Michael Lamertz
On Wed, Aug 28, 2002 at 04:59:59PM +0530, Javeed SAR wrote: > Hi, > > I am reading dirextory using ls. Don't. Use opendir and readdir. The 'perldoc -f readdir' gives you an example how to filter the result by using grep. > How to match for .dsp and .vbp file extensions > > Is this right? >

Constant Question

2002-08-28 Thread Timothy
I am building an array of Tk button and each button will invoke the same subroutine. However I need the index of the calling button to be sent to the subroutine. So far I have a for loop and a SWITCH that that works but it seems to me to be pretty poor coding: for ($intIndex=0; $intIndex<20; $i

sorting log

2002-08-28 Thread bobby
Hi all I have a log file which is generated by backup script and i am writing a perl script to sort the log so as to prepare it to put into mysql database and iam having a problem in doing that. my log file is like this (I have written line numbers for clarity only ) 1 INCREMENTAL OF staf

scalar context?

2002-08-28 Thread Eddie C.
Hello, I have 2 little programs here and they do different things, but I don't understand why. # First program use warnings; use strict; my $line = "TRAVSTAT 08-27-2002 02:20:15 There is no output file required."; (my $word) = ($line =~ /(\S+)/); print $word; # Prints TRAVSTAT # Second progra

AW: How to unshift to an array in an array of arrays?

2002-08-28 Thread Angerstein
Than its possible: my $x = 0; > my @arr1 = (1, 2, 3); > my @arr2 = (4, 5, 6); > my @arr3 = (7, 8, 9); > my @arrofarrs; > unshift (@arrofarrs, \@arr3); > unshift (@arrofarrs, \@arr2); > unshift (@arrofarrs, \@arr1); unshift (@arr1, $x); and it will be in @arrofarrs. right? > -Ursprünglich

matching file extension .vbp and .dsp

2002-08-28 Thread Javeed SAR
Hi, I am reading dirextory using ls. How to match for .dsp and .vbp file extensions Is this right? if ($file1 =~ m/\.vbp$/)

Re: Customer Name Parsing

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 10:11:16 GMT, [EMAIL PROTECTED] (Harry Jackson) wrote: > What I would like to know is if there are any modules > that can find similar matches in this data (soundex in Oracle is > not quite up to the task). Have you already checked out http://search.cpan.org/author/MAR

Re: push to array , then separate again?

2002-08-28 Thread John W. Krahn
David Samuelsson wrote: > > I have gotten 2 values, they "belong" to eachother but i want > to use them later. So i pushed em into an array for use later > like this: > > $text = "$first $second\n"; > push (@array,$text); > > the array works and if i do an foreach loop inside the array

Re: How to unshift to an array in an array of arrays?

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, Angerstein wrote: > How to unshift to an array in an array of arrays? Something like this my @arr1 = (1, 2, 3); my @arr2 = (4, 5, 6); my @arr3 = (7, 8, 9); my @arrofarrs; unshift (@arrofarrs, \@arr3); unshift (@arrofarrs, \@arr2); unshift (@arrofarrs, \@arr1); An array of a

Re: eval on a $SIG{KILL}- newbie question

2002-08-28 Thread Michael Lamertz
I think Bob's theory 1 fits. The die is never called. You put an alarm handler into your program which is set for 10 seconds. I suppose the timeout for the ssh module is more like 30 seconds, so the alarm catches first. On Tue, Aug 27, 2002 at 01:46:20PM -0400, Chad Kellerman wrote: > > How do

How to unshift to an array in an array of arrays?

2002-08-28 Thread Angerstein
How to unshift to an array in an array of arrays? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Customer Name Parsing

2002-08-28 Thread Jackson, Harry
Hi all I have a list of about 10,000 customers in an Oracle database. An example of the type of dat we have is as follows, REGUS CONSULTING REJUS CONSULTANTS REGUS CONSULTANTS RGS CONSULTANTS RGS C/TANTS REGUS CONSULTING LTD REGUS CONSULTING LIMITED RGS CONSULTANTS LTD These are imaginary examp

Re: Checking for .jpg/.gif/.png files

2002-08-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Hello, All: Hello, > I need to check files to make sure that they are .gif, .jpg, or .png > graphic files before processing them. How can I verify that? > > e.g., In unix, the 'type' command returns the file's type. In Unix the 'file' command returns the file's ty

Re: push to array , then separate again?

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, David Samuelsson (PAC) wrote: I don't think you have enabled warnings or use strict, add them and save on your debugging time. > I have gotten 2 values, they "belong" to eachother but i want to use them later. So >i pushed em into an array for use later like this: > >

push to array , then separate again?

2002-08-28 Thread David Samuelsson (PAC)
I have gotten 2 values, they "belong" to eachother but i want to use them later. So i pushed em into an array for use later like this: $text = "$first $second\n"; push (@array,$text); the array works and if i do an foreach loop inside the array la

Re: conditional statement

2002-08-28 Thread Janek Schleicher
Javeed Sar wrote at Wed, 28 Aug 2002 07:38:14 +0200: > if (($vbpcount==1) ||($dspcount==1)) > { die "\n\nThe element ($PN) is not allowed to be added to > ClearCase,Because a project already exists.\n"; > } > > elsif(($vbpcount==1) && ($dspcount==1)) > {die "\n\nThe element ($PN) is not allowe

Redirect STDOUT and SDTERR

2002-08-28 Thread NYIMI Jose (BMB)
I need to redirect STDOUT and SDTERR to a predefined logfile. I wrote this so far: $log_full_name and open (STDOUT,">$log_full_name") or warn "can not redirect STDOUT to $log_full_name : $!\n"); open (STDERR,">&STDOUT") or warn "can not redirect STDERR : $!\n"); May I ask to review this code a