Re: Need to extract just the mac id

2002-08-01 Thread John W. Krahn
Ernie Tucker wrote: > > I have a file with the following data in it. What I am trying to do is just > grab the mac id. Is there a good way to do this in perl. I tried to grep on > just 00 but that gave me more info than what I need. Thanks for any help. > > 0008.0e39.ad80 > Account: 1039

Re: Syntax Culture

2002-08-01 Thread Jenda Krynicky
From: Wiggins d'Anconia <[EMAIL PROTECTED]> > Sorry this is so delayed, but I have to exploit the chance to be anal > :-)... > > In two of the responses the language of "creating a value" was used, > which is also dangerous in a *philosophical* way (I use the term > extremely lightly), in such t

Re: how to use socketpair to run another program

2002-08-01 Thread Steve Grazzini
Ken <[EMAIL PROTECTED]> wrote: > I have an external program (not in perl, and not written by me). > I want to send a string to it, have it do it's thing, then return > the output to my perl program. Then, depending on the results, I > might need to run the external program again with a differen

perl and ldap

2002-08-01 Thread peter grotz
hi list, I want to use ldap as a kind of database for our drawnings. Are there any tutorials how to use perl with the perl-ldap-modul ? Thanks for your help! -- peter grotz rehberger architekten schertlinstr 23 86 159 augsburg tel 0821 25980-29 fax 0821 25980-20 -- To unsubscribe, e-mail

AW: Perl Array Question

2002-08-01 Thread Theuerkorn Johannes
That looks Ok, going to try it with the explicit code... Thanks for Advice! Johannes -Ursprüngliche Nachricht- Von: Connie Chan [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 1. August 2002 13:48 An: Theuerkorn Johannes Betreff: Re: Perl Array Question That's luck that you want a r

Weekly list FAQ posting

2002-08-01 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address)

sendmail problem

2002-08-01 Thread loan tran
Howdy, 1. Can a variable store a text file with 4+ bytes in size? 2. How can I cc or send a message to 2 persons at the same time using sendmail? 3. Could someone please suggest a better way than mine to send a content of a text file using sendmail. Below is part of my script. The problem i

Embedding C in Perl

2002-08-01 Thread Andrew Killam
Hi, guys. This is my first message to the list, so if I'm violating any posting procedures, please forgive me - I'll learn quickly enough. I'm working a program manipulating trees read in from a database. My employers want Perl used, but I believe parts of it would be better served using C fu

how to grab a parameter from command line and do a search and replace in script

2002-08-01 Thread Larry Steinberg
Hi, First, thanks to all the gurus who've been so helpful to me in the past. Here's a new one... I have a script that creates a report of error codes from the access log. There are about a dozen different codes that are meaningful to us. I want to find a way to allow the user to run the script fr

Frame

2002-08-01 Thread Omar Shariff
Hi, i'm trying to do something like this, a page that ask a number and then executes a perl cgi and return data from the database. I do that, now i want that the cgi (when i press the button in the number page) return two frames, upper frame with one datas and down frame with other, i don't know h

RE: Frame

2002-08-01 Thread Bob Showalter
> -Original Message- > From: Omar Shariff [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 01, 2002 10:47 AM > To: [EMAIL PROTECTED] > Subject: Frame > > > Hi, i'm trying to do something like this, a page that > ask a number and then executes a perl cgi and return > data from the data

condition problem

2002-08-01 Thread Gary Stainburn
Hi all, I've got the following code segment, which doesn't work. Regardless of the contents of $fields{'terms1'} $fields{'invcr'} always contains 'I', as shown below. As far as I can see, the condition looks correct. __BEGIN__ $fields{'terms1'}=&tstr(&gettext(7,38,50)); print STDERR "ter

Re: Embedding C in Perl

2002-08-01 Thread Paul Johnson
On Thu, Aug 01, 2002 at 10:13:42AM -0700, Andrew Killam wrote: > Hi, guys. This is my first message to the list, so if I'm violating > any posting procedures, please forgive me - I'll learn quickly enough. The only thing I would complain about is that your lines are too long, but I'd aim that m

Re: sendmail problem

2002-08-01 Thread Robin Norwood
loan tran <[EMAIL PROTECTED]> writes: > Howdy, > > 1. Can a variable store a text file with 4+ bytes > in size? I am under the impression that a scalar can be as big as you need. I *suspect* that the problem lies in limitations on the size of an < 2. How can I cc or send a message to 2 per

RE: condition problem

2002-08-01 Thread Shishir K. Singh
Well...you are checking for REVERSE whereas you should check either for REVERS or REVERSAL -Original Message- From: Gary Stainburn [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 11:08 AM To: [EMAIL PROTECTED] Subject: condition problem Hi all, I've got the following code s

Re: condition problem

2002-08-01 Thread Paul Johnson
On Thu, Aug 01, 2002 at 04:08:29PM +0100, Gary Stainburn wrote: > Hi all, > > I've got the following code segment, which doesn't work. Regardless of the > contents of $fields{'terms1'} $fields{'invcr'} always contains 'I', as shown > below. > > As far as I can see, the condition looks correc

Re: condition problem

2002-08-01 Thread Gary Stainburn
Hi Paul, On Thursday 01 Aug 2002 4:21 pm, Paul Johnson wrote: > On Thu, Aug 01, 2002 at 04:08:29PM +0100, Gary Stainburn wrote: > > Hi all, > > > > I've got the following code segment, which doesn't work. Regardless of > > the contents of $fields{'terms1'} $fields{'invcr'} always contains 'I', >

Extract text from argument

2002-08-01 Thread FlashGuy
Hi all, I have the following line in my Perl script $test=$ARGV[0] which dumps the following results =D:\temp\test\filename I need to extract only the "filename" to the right of the last "\" and put that into a variable. There could only be one "\" in the path or possibly more. This will var

Re: Editor

2002-08-01 Thread zentara
On Wed, 31 Jul 2002 08:43:43 -0500, [EMAIL PROTECTED] (Scott Barnett) wrote: >Hi, > >I am new to Perl just over a month now. I have tried other programming languages and >they just seem to hard to understand. I have found Perl to be a lot easier to >understand, and that brings me to my questio

Re: Extract text from argument

2002-08-01 Thread Robin Norwood
"FlashGuy" <[EMAIL PROTECTED]> writes: > Hi all, > > I have the following line in my Perl script > > $test=$ARGV[0] which dumps the following results > > =D:\temp\test\filename > > I need to extract only the "filename" to the right of the last "\" and put that into >a variable. > There could

Re: Extract text from argument

2002-08-01 Thread FlashGuy
I took a look on www.perldoc.com and checked out "split". I can't figure out how to do it from the examples? Help? On Thu, 01 Aug 2002 11:48:22 -0400, FlashGuy wrote: > > You mean "split"? > > On 01 Aug 2002 11:41:51 -0400, Robin Norwood wrote: > > > "FlashGuy" <[EMAIL PROTECTED]> writes:

RE: Need to extract just the mac id

2002-08-01 Thread nkuipers
>perl -lne'/^[[:xdigit:]]{4}(?:\.[[:xdigit:]]{4}){2}$/&&print' yourfile >From the original question, I believe that the desired target is 0008.0e39.ad80 and lines like it in the file. From your regex, I understand the anchors, and the quantifiers, and the clustering without capturing. Could

changing multiple flags and changing them back

2002-08-01 Thread Paul Tremblay
I have a series of flags that I need to change all at once, and then change back, and was wondering if I could use an array or hash to do this. I am parsing an RTF file, and when I find a footnote, I need to preserve the flags of the non-footnote text. So if I was in a table, I need to save the $

RE: Extract text from argument

2002-08-01 Thread Shishir K. Singh
>I took a look on www.perldoc.com and checked out "split". I can't figure out how to >do it from the examples? >Help? Try out the following piece of code : use File::Spec; use strict; my $test = "C:\\temp\\test\\filename"; my ($volume,$directories,$file) = File::Spec-

Add directories to @INC

2002-08-01 Thread Harry Putnam
I've been pounding perldoc for a while this morning trying to find a clear technique described to add directories to @INC (permanently). I'm sure its described somewhere but I'm not finding it. I know about the -I switch method but wanted to add certain directories permanently so perl -V will di

RE: how to grab a parameter from command line and do a search and replace in script

2002-08-01 Thread nkuipers
I am not sure about the search-and-replace aspect; too tired to even try. However as far as I understand, Getopt::Std only allows single digit parms that either accept a value or are boolean for being set at all. If you want a multi-digit parm, you need Getopt::Long. Documentation of the mos

RE: sendmail problem

2002-08-01 Thread nkuipers
>> 1. Can a variable store a text file with 4+ bytes >> in size? > >I am under the impression that a scalar can be as big as you need. I >*suspect* that the problem lies in limitations on the size of an part. I was under the

[Robin Norwood ] Re: Extract text from argument

2002-08-01 Thread Robin Norwood
--- Begin Message --- No, 'split' is a built-in function, which you could also use. The reason I recommend File::Spec is that it is portable and standard. Generally, if a cpan module exists which covers your task, I'd use it. The 'split' method would be: my $file = (split /\\/, $test)[-1]; Whi

RE: Add directories to @INC

2002-08-01 Thread Shishir K. Singh
>I've been pounding perldoc for a while this morning trying to find a >clear technique described to add directories to @INC (permanently). >I'm sure its described somewhere but I'm not finding it. >I know about the -I switch method but wanted to add certain >directories permanently so perl -V wi

Re: sendmail problem

2002-08-01 Thread Robin Norwood
nkuipers <[EMAIL PROTECTED]> writes: > >> 1. Can a variable store a text file with 4+ bytes > >> in size? > > > >I am under the impression that a scalar can be as big as you need. I > >*suspect* that the problem lies in limitations on the size of an < >document - but someone more knowledgabl

RE: Extract text from argument

2002-08-01 Thread nkuipers
I suggest looking into the File::Basename module, which is bundled with perl. Most current documentation can be found at: http://search.cpan.org/doc/JHI/perl-5.8.0/lib/File/Basename.pm I suppose you could also use a regex...something like this perhaps? /.*(\\\w+)$/ cheers, nathanael -- T

RE: changing multiple flags and changing them back

2002-08-01 Thread Shishir K. Singh
>I have a series of flags that I need to change all at once, and then >change back, and was wondering if I could use an array or hash to do >this. >I am parsing an RTF file, and when I find a footnote, I need to preserve >the flags of the non-footnote text. So if I was in a table, I need to >save

RE: changing multiple flags and changing them back

2002-08-01 Thread Bob Showalter
> -Original Message- > From: Paul Tremblay [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 01, 2002 12:17 PM > To: [EMAIL PROTECTED] > Subject: changing multiple flags and changing them back > > > I have a series of flags that I need to change all at once, and then > change back, and

Re: Add directories to @INC

2002-08-01 Thread Harry Putnam
"Shishir K. Singh" <[EMAIL PROTECTED]> writes: >>I've been pounding perldoc for a while this morning trying to find a >>clear technique described to add directories to @INC (permanently). > >>I'm sure its described somewhere but I'm not finding it. > >>I know about the -I switch method but wanted

RE: Add directories to @INC

2002-08-01 Thread Shishir K. Singh
>>I've been pounding perldoc for a while this morning trying to find a >>clear technique described to add directories to @INC (permanently). > >>I'm sure its described somewhere but I'm not finding it. > >>I know about the -I switch method but wanted to add certain >>directories permanently so pe

RE: Add directories to @INC

2002-08-01 Thread nkuipers
Page 300 of the Camel 3rd ed says: "any modifications to @INC need to occur at compile time...You can do this with the lib pragma described in Chapter 31 or with a BEGIN block." I think what our colleague meant by reinstalling Perl is that doing so will enable you to tell Perl where to look fo

RE: Add directories to @INC

2002-08-01 Thread Shishir K. Singh
>>I've been pounding perldoc for a while this morning trying to find a >>clear technique described to add directories to @INC (permanently). > >>I'm sure its described somewhere but I'm not finding it. > >>I know about the -I switch method but wanted to add certain >>directories permanently so per

Re: Add directories to @INC

2002-08-01 Thread David T-G
Harry -- ...and then Harry Putnam said... % % I've been pounding perldoc for a while this morning trying to find a % clear technique described to add directories to @INC (permanently). There are a number of ways to *update* @INC, but I know of no way to permanently *change* it. I think you're

Regexp to match by hash key and replace with hash value?

2002-08-01 Thread chris
Can I do the following with a single replace? my %hash = ("1","abc", "2","xyz"); my $line = '12'; while( my($key, $val) = each(%hash) ) { $line =~ s/$key/$val/g; } print $line . "\n"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread Bob Showalter
> -Original Message- > From: chris [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 01, 2002 12:58 PM > To: [EMAIL PROTECTED] > Subject: Regexp to match by hash key and replace with hash value? > > > Can I do the following with a single replace? > > my %hash = ("1","abc", "2","xyz");

Re: Add directories to @INC

2002-08-01 Thread David T-G
Harry -- ...and then David T-G said... % % ...and then Harry Putnam said... % % % % I've been pounding perldoc for a while this morning trying to find a % % clear technique described to add directories to @INC (permanently). % % There are a number of ways to *update* @INC, but I know of no way

Re: sendmail problem

2002-08-01 Thread loan tran
Robin et all, I've tried what you recommended but still face the same problem, some of my receivers do not receive full message. I cannot figure out why. Here is new code. (note that @ownerlist has 25 elements) # foreach $eachowner(@ownerlist){ $sql_ownwhat = qq(select sybaseServer, dbNa

RE: Regexp to match by hash key...

2002-08-01 Thread nkuipers
The reply given by Bob highlights surrounding var names within regexes with {}, ie., /${somevar}/. And though not related to your query, as a point of readability, consider using the big-arrow key-value notation when appropriate as in the current example, ie., my %hash = (1 => 'abc',

RE: Need to extract just the mac id

2002-08-01 Thread Felix Geerinckx
on Thu, 01 Aug 2002 16:15:33 GMT, Nkuipers wrote: > Could you please elaborate on the nested character-class brackets and > colon use, or point me in the right direction; I am not familiar with > that notation. Search perldoc perlre for 'POSIX character class syntax' for an explanation

RE: Regexp to match by hash key...

2002-08-01 Thread Felix Geerinckx
on Thu, 01 Aug 2002 17:14:40 GMT, Nkuipers wrote: > my %hash = (1 => 'abc', > 2 => 'xyz'); > > anything to the left of the big-arrow is implicitly quoted as well. Not *anything*, only bare identifiers. Consider my %hash = ( 0123 => 'Watch out!' ); print "'$_'" for (keys

Monthly posting statistics - July 2002

2002-08-01 Thread Felix Geerinckx
Monthly posting statistics for perl.beginners - July 2002. >From 2002-07-01 to 2002-07-31 there were 1968 articles posted (93176 lines) by 327 authors, giving an average 6.02 articles per author, and an average article length of 47 lpa. The average number of articles per day was 63. There were

Re: sendmail problem

2002-08-01 Thread Robin Norwood
Ummm...I'm running out of idea pretty quickly here - here are some things to 'try'... First, check to make sure that $reportdir/$eachowner.mail contains what you want it to after the first part runs, but before the sendmail stuff. Also, I notice that you are appending to these files - '>>'. Are

RE: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread Bob Showalter
> -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 01, 2002 1:02 PM > To: 'chris'; [EMAIL PROTECTED] > Subject: RE: Regexp to match by hash key and replace with hash value? > > > > -Original Message- > > From: chris [mailto:[EMAIL PROTE

Re: perl and ldap

2002-08-01 Thread drieux
On Thursday, August 1, 2002, at 01:25 , peter grotz wrote: > I want to use ldap as a kind of database for our drawnings. > Are there any tutorials how to use perl with the perl-ldap-modul ? > Thanks for your help! I will presume that you have already gone through Net::LDAP::FAQ and Net

pattern matching

2002-08-01 Thread learn perl
Hi guys, I am sure this questions has been asked so many times but please help me on this one. I have a file with the following pattern

Re: pattern matching

2002-08-01 Thread Felix Geerinckx
on Thu, 01 Aug 2002 18:18:27 GMT, Learn Perl wrote: > how do I find the line with only the "<" character? > > and store that line in a hash and the rest chomp them and store them > as the hash value? This stores the (chomped) lines as strings in an anonymous array: #! perl -w use stric

RE: pattern matching

2002-08-01 Thread nkuipers
>how do I find the line with only the "<" character? %perldoc perlre In the meantime, you could set the record separator to <, that is, $/ = '<'; then make a regex that captures the filename part separate from the rest. if (/^(filenamepattern)(.*)

RE: pattern matching

2002-08-01 Thread learn perl
Thanks guys, so to assign each key and add additional keys I could just write a loop and continue to add more keys into the hash right? so I could do chomp(@file) foreach @file{ (if $_ =~ /\ >how do I find the line with only the "<" character? > > %perldoc perlre > > In the meantime, y

RE: pattern matching

2002-08-01 Thread Felix Geerinckx
on Thu, 01 Aug 2002 19:06:55 GMT, Learn Perl wrote: > $hash{$key} = "$hash{$key}","$_"; #I want to concatenate You are not concatenating here. You are assigning "$hash{$key}" to $hash{$key} and then throw away "$_". Perl would have told you this if you had turned on warnings. String concatenat

Re: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread chris
I need something like this to work my %hash = (1=>"abc", 2=>"xyz"); my $line = '1324'; $line =~ s/[12]/$hash{$1}/g; print $line . "\n"; #expected result abc3xyz4 #actual result 34 On Thu, 1 Aug 2002 13:01:41 -0400 , [EMAIL PROTECTED] (Bob Showalter) wrote: >> -Original Message- >> Fr

Re: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread chris
ok now how to build this on the fly using %hash ([12]) On Thu, 1 Aug 2002 16:01:24 -0400, [EMAIL PROTECTED] (Shishir K. Singh) wrote: >You forgot to put the brackets () around [12] >$line =~ s/([12])/$hash{$1}/g; > >-Original Message- >From: chris [mailto:[EMAIL PROTECTED]] >Sent: Thurs

RE: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread Shishir K. Singh
my %hash = (1=>"abc", 2=>"xyz"); my $line = '1324'; my @keys = keys %hash; $line =~ s/([@keys])/$hash{$1}/g; print $line . "\n"; -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 4:14 PM To: [EMAIL PROTECTED] Subject: Re: Regexp to match by hash key

Re: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread chris
Thank you for your help. On Thu, 1 Aug 2002 16:25:26 -0400, [EMAIL PROTECTED] (Shishir K. Singh) wrote: >my %hash = (1=>"abc", 2=>"xyz"); >my $line = '1324'; >my @keys = keys %hash; >$line =~ s/([@keys])/$hash{$1}/g; >print $line . "\n"; > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: perl and ldap

2002-08-01 Thread Michael Fowler
On Thu, Aug 01, 2002 at 10:25:39AM +0200, peter grotz wrote: > I want to use ldap as a kind of database for our drawnings. I hope you've evaluated this decision. When I was first learning about LDAP I noticed I kept trying to fit my problems to LDAP, rather than objectively decide whether LDAP w

Re: Add directories to @INC

2002-08-01 Thread Jenda Krynicky
From: Harry Putnam <[EMAIL PROTECTED]> > I've been pounding perldoc for a while this morning trying to find a > clear technique described to add directories to @INC (permanently). > > I'm sure its described somewhere but I'm not finding it. > > I know about the -I switch method but wanted to ad

How to create DBI connection on unix to MS SQL server ?

2002-08-01 Thread learn perl
Hi guys, just wondering how to establish a DBI connection from a unix machine to a WINNT machine running MS SQL server? do I have to specify an OBDC? Thanks Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

getting a windows PID

2002-08-01 Thread HENRY,MARK (HP-Roseville,ex1)
Hi All, I want to write something simple to kill a known process on a windows machine. Known by name, not PID. Is there any function to get the process id of a given app/process name? On another note, when requesting a process to exit, is it good practise to send a signal for something a littl

Re: Add directories to @INC

2002-08-01 Thread Harry Putnam
"Jenda Krynicky" <[EMAIL PROTECTED]> writes: >> I've been pounding perldoc for a while this morning trying to find a >> clear technique described to add directories to @INC (permanently). >> >> I'm sure its described somewhere but I'm not finding it. >> >> I know about the -I switch method but

system, pkzip, and working directory

2002-08-01 Thread Auernheimer, Rebecca (CORP, Consultant)
I'm having trouble with a little backup job I wrote. I'm using Win 2000 and Perl 5.6.1. This backup job gathers a few files into one location, then zips them up, then deletes the original files. I use the system command for the zipping, because I use an external application (pkzip) for that. T

speed and perl

2002-08-01 Thread Paul Tremblay
This question may be too vague for a good answer, but my curiosity makes me ask it anyway. I thought I read somewhere that perl is actually faster than C for certain tasks. The vagueness of the question probably lies in exactly what task, who writes the program, the size and type of data, and a do