Re: looking for a string in multiple files

2003-01-21 Thread Marco
On Tue, Jan 21, 2003 at 07:48:27PM -0500, Pete Emerson <[EMAIL PROTECTED]> wrote: > You were going for the contents of $file1, correct? Correct. > > Here's my stab. Read in the target files first, then match. > When it walks through the source file, it will print out the name of all > target fi

RE: Random Access File

2003-01-21 Thread Beau E. Cox
Hi - > -Original Message- > From: Galbayar Dorjgotov [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 21, 2003 8:32 PM > To: [EMAIL PROTECTED] > Subject: Random Access File > > > > How to access and create RandomAccessFile > could u send me simple example? > All (most - i.e. STDIN,

Random Access File

2003-01-21 Thread Galbayar Dorjgotov
How to access and create RandomAccessFile could u send me simple example? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Regex needed.

2003-01-21 Thread George P.
On Tue, 21 Jan 2003, Dan Muey wrote: > > > > Hi, > > > > my ($str) = "HI, HELLO, GREETINGS"; > > my ($reg) = "(BYE|HI|CIAO)"; > > > > if ($str =~ /$reg/) > > { print "Exists in $str\n"; } > > > > The above code, will return true if BYE, HI or CIAO exists > > in $str. > > I want a regex to b

default desktop install RedHAT 8.0, trouble installing Perl Module Tk

2003-01-21 Thread James Cox
I am running RedHAT Linux 8.0 with the BlueCurve Gnome Desktop (default RH 8.0). I am having trouble installing some perl modules. My installation is the default so I am probably not the only one using RH 8.0 with this sorta problem. Tk, and Tk::JPEG. I tried both by using cpan and by downloadin

Re: My list declaration

2003-01-21 Thread R. Joseph Newton
Janek Schleicher wrote:Of course, but it like with mathematics. > If at the left side of a = is a list then there must be also a list at the > right side. Sort of. It certainly helps if you want to use the variables in the target list. Perl will merrily assign a one-element list to a list of a

Re: Need help parsing a DN

2003-01-21 Thread R. Joseph Newton
Sporry about the typo. [corrected inline below.I changed over to a named variable while hacking the problem, and just pasted it back in too quickly. It work also with the builtin variable. Joseph R. Joseph Newton" wrote: > Paul Harwood wrote: > > > What would be the best method to parse the

Re: My, our, local

2003-01-21 Thread R. Joseph Newton
> Try this: > > use strict; > print "Global \$main::foo is at ", \$main::foo, "\n"; > our $foo = 'One'; > print "a: addr=", \$foo, ", val=$foo\n"; > { > our $foo = 'Two'; > print "b: addr=", \$foo, ", val=$foo\n"; > } > print "c: addr=", \$foo, ", val=$foo\ --Bob Hi

problems with big numbers

2003-01-21 Thread Konrad Foerstner
Hi, My todays problem: I extraxt some data out of a file, stored them etc., put them into an equation and print it to an outputfile in which the results are sorted by some of their values. The equation was first a linear one (and it worked perfectly), but now I would like to work with exponents (b

Re: Need help parsing a DN

2003-01-21 Thread R. Joseph Newton
Paul Harwood wrote: > What would be the best method to parse the following DN? I just want the > first part of this DN so I can create a server list into an array > (EX-MSG-01, EXMSG-02 >etc).CN=EX-MSG-01,CN=Servers,CN=foreignlocation,CN=Administrative > Groups,CN=domain,CN=Microsoft > Exchange,C

Re: Why shouldn't class modules export anything?

2003-01-21 Thread simran
On Wed, 2003-01-22 at 14:44, Rob Richardson wrote: > Greetings! > > With Version 2.0 of the train crew volunteer signup form program about > to go online, I am now turning my attention to Version 3.0, which will > be Done The Right Way. > > To start with, I am going to create a class named Trai

RE: Nested hash creation help !

2003-01-21 Thread Scot
Thanks to Jose and all others who posted. I now have a working nested hash and a better understanding of them. Scot -Original Message- From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 7:34 AM To: [EMAIL PROTECTED] Subject: RE: Nested hash creation help !

Why shouldn't class modules export anything?

2003-01-21 Thread Rob Richardson
Greetings! With Version 2.0 of the train crew volunteer signup form program about to go online, I am now turning my attention to Version 3.0, which will be Done The Right Way. To start with, I am going to create a class named Train. A train has a name, a date, a crew call time, and a bunch of

Re: string negation

2003-01-21 Thread John W. Krahn
Venkateswarlu Bulusu wrote: > > hi Hello, > i was trying to do negation (~) on a string and i was getting strange result. ~ is a numerical operator, not a string operator. > #!/usr/bin/perl > use warnings; > $a = "venkat"; > $b = ~ $a; > print $a, "\n"; > print $b, "\n"; > > when i run this

Re: a split(); question

2003-01-21 Thread R. Joseph Newton
justino berrun wrote: > #hello, is there a way to split a string between a digit and character > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would make three new >strings Try: (my $ElementString = $string) =~ s /(\d+)(\D+)/$1-$2/g; print "$ElementString\n"; $ElementString is th

Re: Regular Expression - Search for Form Feed

2003-01-21 Thread John W. Krahn
Paul Kraus wrote: > > How can I search for form feed. I have tried > > /\f/ > > But I realize that the regexp engine doesn't use \f Yes it does. /\f/ should work. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread david
Michael Kingsbury wrote: >> print Dog::Hello; > > That was it, they weren't exported I think. Refering to them as > Win32::File::ARCHIVE, I don't have the problem. > > -mike you can check what they export by default. for example: [panda@dzhuo]$ perl -MFcntl -e 'print "$_\n" for(@Fcntl::EXPORT

string negation

2003-01-21 Thread Venkateswarlu Bulusu
hi i was trying to do negation (~) on a string and i was getting strange result. #!/usr/bin/perl use warnings; $a = "venkat"; $b = ~ $a; print $a, "\n"; print $b, "\n"; when i run this i am getting blank for $b, and getting 1;2c on the command prompt. when i changed $a from venkat to abcdef not

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread Michael Kingsbury
> print Dog::Hello; That was it, they weren't exported I think. Refering to them as Win32::File::ARCHIVE, I don't have the problem. -mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread david
David wrote: > > print Dog::Hello; > the above should be: print Dog::HELLO; sorry. i mistyped the constant's name. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread david
Michael Kingsbury wrote: > The Win32::File uses ARCHIVE, READONLY, SYSTEM, HIDDEN, etc as constants > for use with the file attribute types. However, with use strict, perl > barfs due to a bareword. > they should be used the same way vars, subs are used. if they are exported, just use them. if

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread Michael Kingsbury
The Win32::File uses ARCHIVE, READONLY, SYSTEM, HIDDEN, etc as constants for use with the file attribute types. However, with use strict, perl barfs due to a bareword. On 22 Jan 2003, simran wrote: > not sure what you mean... > > but perhaps the following might help: > > * use constant

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread simran
not sure what you mean... but perhaps the following might help: * use constant ABC => 'this is some text'; * use vars ... On Wed, 2003-01-22 at 12:28, Michael Kingsbury wrote: > How do I use a (known) Bareword constant from a package when strict's on? > > -mike -- To unsubscribe, e-mai

RE: Bareword Constant from Package giving problems with use stric t....

2003-01-21 Thread Toby Stuart
> -Original Message- > From: Michael Kingsbury [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 22, 2003 12:28 PM > To: [EMAIL PROTECTED] > Subject: Bareword Constant from Package giving problems with use > strict > > > How do I use a (known) Bareword constant from a package wh

Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread Michael Kingsbury
How do I use a (known) Bareword constant from a package when strict's on? -mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: looking for a string in multiple files

2003-01-21 Thread Pete Emerson
> if ($result eq $file1) This is checking to see if each line matches the filename itself, not the contents of file1. You were going for the contents of $file1, correct? Here's my stab. Read in the target files first, then match. When it walks through the source file, it will print out the name

Re: My list declaration

2003-01-21 Thread Janek Schleicher
On Tue, 21 Jan 2003 14:17:19 +, Paul Kraus wrote: > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else'); Of course, but it like with mathematics. If at the left side of a = is

Re: IO::Getline Methode

2003-01-21 Thread Wiggins d'Anconia
Angerstein wrote: ...already searched cpan. Has anybody an idea where I can get the Modul or Methode IO::Getline or IO::Getlines Are they only in Perl 5.8? (I am using 5.0) This appears to be a method(s) included as part of the IO::Handle module, which I believe became available around 5.6

Re: max floating point number

2003-01-21 Thread Wiggins d'Anconia
Konrad Foerstner wrote: Hi, does anybody know the maximum value of floating point numbers I could use in Perl? This is likely either system architecture (aka 32 bit vs. 64 bit) and/or memory size dependent. And then there is the whole signed vs. unsigned thing, but all of that just makes my

RE: My, our, local

2003-01-21 Thread david
Bob Showalter wrote: > I think you're missing the point. Any reference to the symbol anywhere in > the program "creates" the variable, in the sense you indicated here. > > For example: > >package Foo; >our $x = 1; >print "$_\n" for keys %Foo::; >our $y = 1; > > This prints: >

RE: My, our, local

2003-01-21 Thread Bob Showalter
david wrote: > Bob Showalter wrote: > > > Paul Kraus wrote: > > > Maybe I am misunderstanding but that seems to be the exact same > > > thing my does. > > > > No. my() creates a new variable. our() refers to a global variable. > > not sure what you mean by that. 'our' does create new variable if

RE: Regular Expression - Search for Form Feed

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > How can I search for form feed. I have tried > > /\f/ > > But I realize that the regexp engine doesn't use \f But it does! page 72, Mastering Regular Expressions, Friedl. Usually maps to ASCII character, 014 octal. Wags ;) *

Regular Expression - Search for Form Feed

2003-01-21 Thread Paul Kraus
How can I search for form feed. I have tried /\f/ But I realize that the regexp engine doesn't use \f -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: My, our, local

2003-01-21 Thread david
Bob Showalter wrote: > Paul Kraus wrote: >> Maybe I am misunderstanding but that seems to be the exact same thing >> my does. > > No. my() creates a new variable. our() refers to a global variable. not sure what you mean by that. 'our' does create new variable if that variable does NOT already

looking for a string in multiple files

2003-01-21 Thread Marco
What I'm trying to achieve is the following: I have an ASCII text file (zonelist.input) for input which contains a domainname (that is i.e. foo.com) on each line ( a total of about 230 lines are in this file). Furthermore, I have 3 other text files. I'm looking for a method to read each line from

max floating point number

2003-01-21 Thread Konrad Foerstner
Hi, does anybody know the maximum value of floating point numbers I could use in Perl? Konrad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Pack syntax

2003-01-21 Thread wiggins
On Tue, 21 Jan 2003 15:59:12 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > Thanks! > > I like to make more work for myself. In that case you could always just create your hash/array data structure and then use Storable and Freezethaw :-)

Re: My, our, local

2003-01-21 Thread Rob Dixon
R. Joseph Newton wrote: > "... > Unlike 'my', however, it is a permanent > package variable and its value will be retained across calls to a > subroutine ..." --Rob > > Hi Rob, > > So does this make it equivalent to a C-style static variable? Sort of, but beware that any occurrence of 'our $var'

Re: a split(); question

2003-01-21 Thread John W. Krahn
Rob Dixon wrote: > > Justino Berrun wrote: > > #hello, is there a way to split a string between a digit and character > > #without losing the digit or the character > > #Any help would be very appreciated > > > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would > > make three new

Re: My, our, local

2003-01-21 Thread R. Joseph Newton
"... Hi Paul. n 'our' variable has the same visibility as a 'my' variable declared in the same place, i.e. through to the end of the current lexical scope (block or file). Unlike 'my', however, it is a permanent package variable and its value will be retained across calls to a subroutine (unless m

RE: Pack syntax

2003-01-21 Thread Paul Kraus
Thanks! I like to make more work for myself. -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 3:56 PM To: '[EMAIL PROTECTED]'; Wagner, David --- Senior Programmer Analyst --- WGO; 'Perl' Subject: RE: P

RE: Pack syntax

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > I have two text files that are exported from our shipping computers > each night. > > One is FedEx and contains a space delimitated file with two fields. > OrderNumber TrackingNumber > > The other is UPS and contains a CSV file with two fields. > "OrderNumber","TrackingNumber"

RE: My list declaration

2003-01-21 Thread Paul Kraus
My ($var1,$var2) = ('something','something else'); Was exactly what I wanted. :) -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 3:40 PM To: [EMAIL PROTECTED] Subject: Re: My list declaration Bob Showalter wrote: > Paul Kraus wrote: >> Can

Re: Win32 File Attribs Example.

2003-01-21 Thread Rob Dixon
Michael Kingsbury wrote: > Does anyone have an example of determinting the file attibute bits of > a file? I can get the bits, but have no easy way of determining > what's what. I'm using the Win32::File::GetAttributes function. > Hi Mike. The bitmasks COMPRESSED, DIRECTORY, HIDDEN, NORMAL, OFF

Re: My, our, local

2003-01-21 Thread R. Joseph Newton
"... Unlike 'my', however, it is a permanent package variable and its value will be retained across calls to a subroutine ..." --Rob Hi Rob, So does this make it equivalent to a C-style static variable? I've been trying to test it, and it seems to be impossible to even declare it using strict.

RE: Tie? Why?

2003-01-21 Thread Bob Showalter
Rob Richardson wrote: > Greetings! > > I am beginning to seriously consider what I am going to have to do to > wrestle some reasonable amount of organization out of the unbelievable > pile of spaghetti I've been trying to update. I managed to add what I > needed; now I'm going to go back and do i

RE: Pack syntax

2003-01-21 Thread Paul Kraus
I have two text files that are exported from our shipping computers each night. One is FedEx and contains a space delimitated file with two fields. OrderNumber TrackingNumber The other is UPS and contains a CSV file with two fields. "OrderNumber","TrackingNumber" I wanted to have a script that w

Re: My list declaration

2003-01-21 Thread Rob Dixon
Bob Showalter wrote: > Paul Kraus wrote: >> Can you define a list with my? >> >> I tried >> my ($var1, $var2) = 'something','something else'; >> I have also tried >> my ($var1, $var2 = 'something','something else'); > > Close! You need: > >my ($var1, $var2) = ('something', 'something else');

RE: Pack syntax

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > You are of course correct. After some digging I seems that the problem > was in my unpack statement. When I actually checked the packed > variable all the data was there. > > I was doing .. My ($a,$b) = unpack("A A",$buffer); > When I added ... Unpack "A* A*" > It sort of w

Windows XP - xemacs - Color syntax

2003-01-21 Thread Paul Kraus
I have just installed xemacs on my windows xp machine. I am working in mode cperl-mode. From my understanding it is supposed to have syntax highlighting. Is this untrue of the windows port? Do I need to turn it on somewhere? Paul Kraus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: doubt in pattern matching

2003-01-21 Thread Dan Muey
> dear friends: Howdy > > i have a simple doubts in reguler exepration see the the > passage that follows is stored in a variable by name v. in > the fifth line see the words like this "Next 20 ^ " now i > want delete all the charecter before ^- sign in my variable v. > > shall i use find and

Re: Need help parsing a DN

2003-01-21 Thread Rob Dixon
Paul Harwood wrote: > What would be the best method to parse the following DN? I just want > the first part of this DN so I can create a server list into an array > (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure > how to get the first part of the text I want. Any help appreciat

RE: Pack syntax

2003-01-21 Thread Paul Kraus
You are of course correct. After some digging I seems that the problem was in my unpack statement. When I actually checked the packed variable all the data was there. I was doing .. My ($a,$b) = unpack("A A",$buffer); When I added ... Unpack "A* A*" It sort of worked. It just unloads $buffer i

Re: a split(); question

2003-01-21 Thread Rob Dixon
Justino Berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would > make three new strings > > @newstrings=split(/(\

doubt in pattern matching

2003-01-21 Thread kasi ramanathen
dear friends: i have a simple doubts in reguler exepration see the the passage that follows is stored in a variable by name v. in the fifth line see the words like this "Next 20 ^ " now i want delete all the charecter before ^- sign in my variable v. shall i use find and replace to find all th

Re: other new news ???

2003-01-21 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > Hi all, > > i have head that switch is introduced from perl 5.8. what are all the > other new additions to the perl??? > > enlighten me -- Hi. Take a look at "perldelta - what is new for perl v5.8.0" here: http://dev.perl.org/perl5/news/2002/07/18/580ann/perldelta.

RE: Pack syntax

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > I am creating a simple database that needs to contain 3 fields. > Date, order number, tracking number. > > I figured I would use a dbmhash and use pack to get the data in. > So my hash would be %hash{tracking_number}=$packeddata. > > The date and order number are both strings.

Re: Tie? Why?

2003-01-21 Thread John W. Krahn
Rob Richardson wrote: > > Greetings! Hello, > I am beginning to seriously consider what I am going to have to do to > wrestle some reasonable amount of organization out of the unbelievable > pile of spaghetti I've been trying to update. I managed to add what I > needed; now I'm going to go back

Pack syntax

2003-01-21 Thread Paul Kraus
I am creating a simple database that needs to contain 3 fields. Date, order number, tracking number. I figured I would use a dbmhash and use pack to get the data in. So my hash would be %hash{tracking_number}=$packeddata. The date and order number are both strings. So using the information I rece

Win32 File Attribs Example.

2003-01-21 Thread Michael Kingsbury
Does anyone have an example of determinting the file attibute bits of a file? I can get the bits, but have no easy way of determining what's what. I'm using the Win32::File::GetAttributes function. -mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: slurping function like shell

2003-01-21 Thread Bob Showalter
R. Joseph Newton wrote: > The die function can be very useful > working in console mode, but it is hell for CGI debugging. > Since errors go into the server error log, which tends to be > accessible only to the system admin, it can be damn near > useless to have die statements in a CGI script. You

Tie? Why?

2003-01-21 Thread Rob Richardson
Greetings! I am beginning to seriously consider what I am going to have to do to wrestle some reasonable amount of organization out of the unbelievable pile of spaghetti I've been trying to update. I managed to add what I needed; now I'm going to go back and do it the way it should have been done

RE: My list declaration

2003-01-21 Thread wiggins
On Tue, 21 Jan 2003 14:17:19 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else

RE: My list declaration

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else'); > > Thanks. > > Paul When you say list, then hash comes to mind. So to do a list then you need key and dat

RE: My list declaration

2003-01-21 Thread Bob Showalter
Paul Kraus wrote: > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else'); Close! You need: my ($var1, $var2) = ('something', 'something else'); -- To unsubscribe, e-mail: [EMAI

Re: slurping function like shell

2003-01-21 Thread John W. Krahn
Harry Putnam wrote: > > "John W. Krahn" <[EMAIL PROTECTED]> writes: > > > You shouldn't use ampersands unless you need the different behavior they > > provide. > > John, > I asked for a documentation pointer on this in a previous post that > hasn't hit the server here yet, but don't bother with

Re: slurping function like shell

2003-01-21 Thread R. Joseph Newton
" ... > open(FILE,">somefile") or die "Cannot open 'somefile' $!"; Not being argumentative here but I've seen this said before. Not really sure why it is important. I mean why is the open action singled out for this protection. It seems other actions could also cause a misfired script? ..."

My list declaration

2003-01-21 Thread Paul Kraus
Can you define a list with my? I tried my ($var1, $var2) = 'something','something else'; I have also tried my ($var1, $var2 = 'something','something else'); Thanks. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Need help parsing a DN

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Harwood wrote: > What would be the best method to parse the following DN? I just want > the first part of this DN so I can create a server list into an array > (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure > how to get the first part of the text I want. Any help appreciat

RE: Current package name

2003-01-21 Thread Bob Showalter
Beau E. Cox wrote: > Hi - > > How do I get the current package name? For example, > if I have a module that starts with: > > package Beau::Cool::Stuff; > ... > > and I want to give an error (die) later in this module: > > ... > die "invalid stuff passed to Beau::Cool::Stuff::function\n"; ... >

RE: how to print array element & count

2003-01-21 Thread Bob Showalter
R. Joseph Newton wrote: > "... > foreach(1..$total_elements){ > print "\t\[$_\] my $input[$_ - 1 ]\n"; > } > ...Why did scalar $input in the foreach loop > "works" without predeclaring it with my?" --Eri > > HI Eri, > > The my is probably not doing what you think it is. Otherwise > it would

RE: Current package name

2003-01-21 Thread Beau E. Cox
__THANKS__ ;) > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 21, 2003 8:27 AM > To: Beau E. Cox; 'Beginners > Subject: RE: Current package name > > > __PACKAGE__ > > 3rd Camel, page 68, Literals > > http://danconia.org > > > -

Need help parsing a DN

2003-01-21 Thread Paul Harwood
What would be the best method to parse the following DN? I just want the first part of this DN so I can create a server list into an array (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure how to get the first part of the text I want. Any help appreciated. CN=EX-MSG-01,CN=

RE: a split(); question

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
justino berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would > make three new strings > > @newstrings=split(

Re: how to print array element & count

2003-01-21 Thread R. Joseph Newton
"... foreach(1..$total_elements){ print "\t\[$_\] my $input[$_ - 1 ]\n"; } ...Why did scalar $input in the foreach loop "works" without predeclaring it with my?" --Eri HI Eri, The my is probably not doing what you think it is. Otherwise it would constitute a redeclaration error. My guess

Re: a split(); question

2003-01-21 Thread Janek Schleicher
On Wed, 22 Jan 2003 02:46:27 +0800, Justino Berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would make three

Re: Current package name

2003-01-21 Thread Janek Schleicher
On Tue, 21 Jan 2003 08:15:09 +, Beau E. Cox wrote: > How do I get the current package name? For example, > if I have a module that starts with: It's in __PACKAGE__ Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

a split(); question

2003-01-21 Thread justino berrun
#hello, is there a way to split a string between a digit and character #without losing the digit or the character #Any help would be very appreciated $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would make three new strings @newstrings=split(/(\d)([a-zA-Z])/,$string);

RE: Current package name

2003-01-21 Thread wiggins
__PACKAGE__ 3rd Camel, page 68, Literals http://danconia.org On Tue, 21 Jan 2003 08:15:09 -1000, "Beau E. Cox" <[EMAIL PROTECTED]> wrote: > Hi - > > How do I get the current package name? For example, > if I have a module that starts with:

Current package name

2003-01-21 Thread Beau E. Cox
Hi - How do I get the current package name? For example, if I have a module that starts with: package Beau::Cool::Stuff; ... and I want to give an error (die) later in this module: ... die "invalid stuff passed to Beau::Cool::Stuff::function\n"; ... where is the 'package name variable' so I do

RE: Apples, Carrots, and Pecans

2003-01-21 Thread Dan Muey
> I appreciate the input on my recent post for comparing apples > and oranges. Got it working great! Thanks. Now for some more food. > > I have a directory: food. In the directory, there are three > files: apple, carrot, pecan. Each file has three descriptions How are the descriptions formatte

Apples, Carrots, and Pecans

2003-01-21 Thread Bob Williams
I appreciate the input on my recent post for comparing apples and oranges. Got it working great! Thanks. Now for some more food. I have a directory: food. In the directory, there are three files: apple, carrot, pecan. Each file has three descriptions each. Apple has: fruit red round (as its three

RE: other new news ???

2003-01-21 Thread Perry, Alan
[EMAIL PROTECTED] wrote: > Hi all, > > i have head that switch is introduced from perl 5.8. what are all the > other new additions to the perl??? For a complete list of changes, go to: http://dev.perl.org/perl5/news/2002/07/18/580ann/perldelta.html Alan -- To unsubscribe, e-mail: [EMAIL PROTE

other new news ???

2003-01-21 Thread km
Hi all, i have head that switch is introduced from perl 5.8. what are all the other new additions to the perl??? enlighten me -- km -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: My, our, local

2003-01-21 Thread Rob Dixon
Paul Kraus wrote: > Great article. Cleared up all of my confusion. However it did not > touch on "our". Anyone care to explain what its used for. Hi Paul. An 'our' variable has the same visibility as a 'my' variable declared in the same place, i.e. through to the end of the current lexical scope

RE: My, our, local

2003-01-21 Thread Bob Showalter
Paul Kraus wrote: > Maybe I am misunderstanding but that seems to be the exact same thing > my does. No. my() creates a new variable. our() refers to a global variable. Try this: use strict; print "Global \$main::foo is at ", \$main::foo, "\n"; our $foo = 'One'; print "a: addr=", \$foo,

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
Ben Siders <[EMAIL PROTECTED]> writes: > You should always perform all error checking in any language to ensure Well thanks Ben. That was nice full explanation and makes a lot of sense. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: slurping function like shell

2003-01-21 Thread Ben Siders
strftime is an interface to a C function of the same name. It's a fairly common function in many applications that have to deal with dates and times. You may not need it here, but it's not a bad idea to get a little familiar with it. For the life of me, I can't ever remember all the format c

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: > You shouldn't use ampersands unless you need the different behavior they > provide. John, I asked for a documentation pointer on this in a previous post that hasn't hit the server here yet, but don't bother with that please. I found the info in perlf

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: > You should probably be using POSIX::strftime instead which is simpler > and faster. > > use POSIX 'strftime'; > > print FILE strftime( "An extra numeral <%D %T %w> appears\n", > localtime ); Probably coming off like some kind of carpy here but I'm

RE: My, our, local

2003-01-21 Thread Paul Kraus
Great article. Cleared up all of my confusion. However it did not touch on "our". Anyone care to explain what its used for. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 8:40 AM To: Carlos Diaz; [EMAIL PROTECTED] Subject: RE: My, ou

Re: slurping function like shell

2003-01-21 Thread Ben Siders
You should always perform all error checking in any language to ensure that your program, if it fails, declines gracefully. One of the greatest shortcomings of C is that error checking is entirely manual, and you simply must, in every real-world application, check the return value of almost ev

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
Thanks for tips posters.. "John W. Krahn" <[EMAIL PROTECTED]> writes: > You should _always_ verify that the file opened successfully. > > open(FILE,">somefile") or die "Cannot open 'somefile' $!"; Not being argumentative here but I've seen this said before. Not really sure why it is import

RE: Regex needed.

2003-01-21 Thread Dan Muey
> Hi, > > my ($str) = "HI, HELLO, GREETINGS"; > my ($reg) = "(BYE|HI|CIAO)"; > > if ($str =~ /$reg/) > { print "Exists in $str\n"; } > > The above code, will return true if BYE, HI or CIAO exists > in $str. > I want a regex to be put in $reg, which will return true > if neither BYE, HI n

RE: My, our, local

2003-01-21 Thread wiggins
On Mon, 20 Jan 2003 21:11:56 -0600, "Carlos Diaz" <[EMAIL PROTECTED]> wrote: > Can anyone explain in simple terms the difference between the three (my, > our, local). Especially the difference between my and local. Thanks... > > CD I know you ask

RE: Duplicate Mail

2003-01-21 Thread Paul Kraus
Was a double filter. Fixed. -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 8:22 AM To: Perl Subject: Duplicate Mail I just set up a new pc. For some reason I am getting double mail from the list. Any ideas? It not just the mail where "my"

Duplicate Mail

2003-01-21 Thread Paul Kraus
I just set up a new pc. For some reason I am getting double mail from the list. Any ideas? It not just the mail where "my" email address is in the header but every single message period. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: deleting files

2003-01-21 Thread NYIMI Jose (BMB)
C:\>perldoc -f unlink unlink LIST unlink Deletes a list of files. Returns the number of files successfully deleted. $cnt = unlink 'a', 'b', 'c'; unlink @goners; unlink <*.bak>; Note: "unlink" will not delete director

deleting files

2003-01-21 Thread Piotr
Hi all, I am new to perl and I try to remove file with it, but I don't known how :( I find modules File::Copy, File::Find, but not File::Delete :( How can I do this ? Peter ***r-e-k-l-a-m-a** Chcesz oszczedzic na kosztach obslugi bankowej ? mBIZNES - konto dla fi

IO::Getline Methode

2003-01-21 Thread Angerstein
...already searched cpan. Has anybody an idea where I can get the Modul or Methode IO::Getline or IO::Getlines Are they only in Perl 5.8? (I am using 5.0) Thx, Bastian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

  1   2   >